Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Problems? Is your data what you think it is?
 
PerlMonks  

How to validate an XML file against its DTD?

by iza (Monk)
on Oct 19, 2001 at 13:41 UTC ( [id://119980]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

iza has asked for the wisdom of the Perl Monks concerning the following question: (data formatting)

I have an XML file and its DTD file. What module can I use to parse the XML and validate it against the DTD?

Originally posted as a Categorized Question.

  • Comment on How to validate an XML file against its DTD?

Replies are listed 'Best First'.
Re: How to validate an XML file against its DTD?
by davorg (Chancellor) on Oct 19, 2001 at 14:19 UTC
Re: how do i check an xml file against its dtd ?
by tommyw (Hermit) on Oct 19, 2001 at 14:21 UTC

    Dunno about a perl module, but emacs' psgml library invokes nsgmls -s sample.xml, which might help

    Originally posted as a Categorized Answer.

Re: How to validate an XML file against its DTD?
by Corion (Patriarch) on Oct 19, 2001 at 21:38 UTC

    There is a pure XSL(T) answer: the Schematron. It's an XSLT stylesheet; you run it on the DTD, and this produces a second stylesheet, which is a validator for the DTD. You run that on your XML to validate it.

Re: how do i check an xml file against its dtd ?
by Anonymous Monk on Sep 05, 2003 at 07:23 UTC
    <?xml version="1.0" ?> <FINTRANSACTION FTNO= "FT01"> <TXN_TYPE>FINANCIAL TRANSACTION</TXN_TYPE> <TXN> <TXN_NO> FT001 </TXN_NO> <ACCOUNT> 0124221 </ACCOUNT> <AMOUNT> 100,00 </AMOUNT> </TXN> <TXN> <TXN_NO> FT001 </TXN_NO> <ACCOUNT> 0124221 </ACCOUNT> <AMOUNT> 100,00 </AMOUNT> </TXN> <TXN> <TXN_NO> FT001 </TXN_NO> <ACCOUNT> 0124221 </ACCOUNT> <AMOUNT> 100,00 </AMOUNT> </TXN> </FINTRANSACTION>

    Originally posted as a Categorized Answer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://119980]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.