DTD / XSD and checking an XML File

A

arun.hallan

I need to take either a DTD/XSD (preferably a DTD), and use it as a
schema to process an XML file.
Can someone tell me the best way to do so?
 
S

Stanimir Stamenkov

/[email protected]/:
I need to take either a DTD/XSD (preferably a DTD), and use it as a
schema to process an XML file.
Can someone tell me the best way to do so?

Your description is too vague. How do you need to process an XML
file? If you just want to validate XML document against a DTD or XML
Schema - use the standard JAXP API part of the Java 1.4/5 environments.

I'm not sure if the parser shipped with Java 1.4 could actually
validate against XML Schema, but the Xerces2 shipped with Java 5 is
for sure. One may plug Xerces2 with Java 1.4 with no problems, too.

DTD validation is supported on documents which do specify a DOCTYPE
declaration, only (at least using the standard interfaces /
configuration properties). With XML Schema one has much greater
flexibility - read "Properties for enabling schema validation" in
the JAXP spec, or get the same info online:

http://java.sun.com/xml/jaxp/change-requests-11.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,244
Members
46,838
Latest member
KandiceChi

Latest Threads

Top