Link to home
Create AccountLog in
Avatar of nata_v
nata_v

asked on

Validate XML using DTD

How can I validate my XML with a DTD. I don't have an XML aware IDE.
But I do have Saxon 8b jars with me.
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Saxon 8b doesn't explicitely do DTD validation (Saxon is an XSLT processor)
you can use Xerxes for that
xerxes.apache.org
Avatar of nata_v
nata_v

ASKER

I have downloaded Xerces jars. How can I use it to validate an XML with a DTD
The best way to validate a document is to ue one of the sample programms
I usually use DOMCount or SAXCount
here is how to do that
http://xerces.apache.org/xerces-j/domcount.html

please note that you have to put a link to the DTD inside your XML document in order for calling the DTD

<!DOCTYPE root SYSTEM "yourdtd.dtd">
should be the first line
where root is the name of the root element and
between "" after SYSTEM should be the relativ epath + filename of your DTD

cheers

Geert
Avatar of nata_v

ASKER

I can't find the DOMCount class.
I have downloaded xerces-2_5_0 and in the samples directory there is no dom\DOMCount class
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer