Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

How to validate an XML file against its DTD?

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

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 18:19 UTC
Re: How to validate an XML file against its DTD?
by Corion (Patriarch) on Oct 20, 2001 at 01: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 tommyw (Hermit) on Oct 19, 2001 at 18: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 do i check an xml file against its dtd ?
by Anonymous Monk on Sep 05, 2003 at 11: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found