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

I would like to humbly ask advice of the monks.

Does Anybody know a good module, or way, to validate an XML document against a DTD? I have searched cpan and I get thosands of hits searching on "XML" or even "XML DTD", but none of them seem to simply check that an XML document fits a given DTD. I would think this would be a very common thing to want to do, but I simply don't see it out there.

May the Force be with you

Replies are listed 'Best First'.
Re: Validating XML against a DTD
by herveus (Prior) on Sep 17, 2004 at 15:24 UTC
    Howdy!

    CPAN is your friend.

    One approach (there may be more than one) is to use XML::LibXML, with particular attention to XML::LibXML::Dtd to parse a DTD and XML::LibXML::Document to validate (particularly the is_valid and validate methods).

    This took me just a few minutes to look up...

    yours,
    Michael

      Thank you very much Micheal. CPAN is my friend, but I suppose I was imply not using the right search string, or just missed the module. I'll check out XML::LibXML.

      Thanks, again

      May the Force be with you
Re: Validating XML against a DTD
by Anonymous Monk on Sep 17, 2004 at 15:27 UTC
Re: Validating XML against a DTD
by grantm (Parson) on Sep 19, 2004 at 21:04 UTC