Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

XML Syntax Checker

by nick (Sexton)
on Apr 04, 2001 at 23:43 UTC ( [id://69844]=perlquestion: print w/replies, xml ) Need Help??

nick has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have to validate some XML config files, and I need a simple way to do this with perl. I have heard good things about XML::Checker, however it's not on CPAN and it's homepage is no longer in existence.

I am wondering if this was trashed?

Can someone let me know a quick, easy, way to do simple XML syntax checking?
(against a DTD).

Replies are listed 'Best First'.
Re: XML Syntax Checker
by mirod (Canon) on Apr 04, 2001 at 23:47 UTC

    XML::Checker is in libxml-enno, along with XML::DOM, XML::XQL and the likes.

      Thanks! this was my error!
Re: XML Syntax Checker
by Corion (Patriarch) on Apr 04, 2001 at 23:51 UTC

    If you have the XML, the DTD and a XSL processor like Saxon, then the Schematron is for you. The Schematron is an XSL stylesheet that creates a validation stylesheet from the DTD, which is then run against your data - quite nice if you stare long enough at it, but if you stare too long at it, the voices in other peoples heads become too loud so you can't hear the voices in your head anymore.

    From looking at the Schematron homepage, there is talk about there being implementations in Perl and Python as well, but I can't find any of them at the moment...

    I hope that mirod will come up with a Perl solution :-)

Re: XML Syntax Checker
by aardvark (Pilgrim) on Apr 05, 2001 at 01:51 UTC
    There was an interesting article written by Kip Hampton on xml.com about Simple XML Validation with Perl

    You may also want to look at Xerces Perl from the The Apache XML Project

    Here is what they say on the Xerces Perl home page:
    The Xerces Perl project has created a Perl module, Xerces.pm, as the Perl API to the Apache project's Xerces XML parser. It is implemented using the Xerces C++ API, and it provides access to all of the C++ API from Perl. Because it is based on Xerces-C, Xerces.pm provides a validating XML parser that makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents. Xerces.pm is faithful to the XML 1.0 recommendation and associated standards ( DOM 1.0, DOM 2.0. SAX 1.0, SAX 2.0, Namespaces), The parser provides high performance, modularity, and scalability. Source code, samples and API documentation are provided with the parser.

    Get Strong Together!!

Re: XML Syntax Checker
by damian1301 (Curate) on Apr 04, 2001 at 23:47 UTC
      In the "SEE ALSO" section, the homepage is dead. That's where I was trying to go. I did not realize it has been incorporated into a group of mobules (libxml-enno)
        Well, the search came with many results so just keep searching if you need more. If not then I will keep surfing around for you if you need it.

        Almost a Perl hacker.
        Dave AKA damian

        I encourage you to email me

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://69844]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-23 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found