/
[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