Hi, I'm having some trouble with JAXP and Schema validation. Basically I want to parse in XML files that can us a DTD or Schema (for example web.xml, depending on the version it is a DTD or Schema). The main problem is that the XML file refers to external entities that must be resolved so that the file can be parsed on a different system then it was written on. For DTDs this is not that difficult as one can use the public ID. For Schemas things are a bit more tricky though as one only gets the system ID (value of the schemaLocation attribute) in the entity resolver. As this can be anything and is only a hint it doesn't has much use. The other possibility is to use give the parser some XSDs in advance (http://java.sun.com/j2ee/1.4/docs/tu.../JAXPDOM8.html
). The downside of this however is that validation is forced to use the Schema even though it normally would use a DTD. A further problem is that J2EE 1.4 uses different XSD files which all share the same namespace and Xerces doesn't like that.
Any ideas on how to do this right?