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.
But I do have Saxon 8b jars with me.
I had an error in my reference
http://xerces.apache.org/xerces-j/
http://xerces.apache.org/xerces-j/
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
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
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
I have downloaded xerces-2_5_0 and in the samples directory there is no dom\DOMCount class
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
you can use Xerxes for that
xerxes.apache.org