When validating, I get an error like 'element Signature not found', which smells like the parser being unable to find the schema. But, it works perfectly with other schema's, just not with this one.
After some time fiddling around, I found that there is a DOCTYPE in the schema (any one knows why they put a doctype in an xml schema ? I don't understand this) . After removing the doctype, everything works. So the parser is trying to validate against the DTD and the XML schema, but it could not find the DTD and that gave the error.
Now, I'm not happy with this solution (removing the doctype). I feel that it is bad to change the original schema, even if it is a very small modification. So I want to tell the parser that it should totally ignore the Doctypes in the XSD and only perform the schema validation.
It does indeed work, the parser does not uses the DTD anymore, BUT it still expects to FIND the DTD. So I still get an error:
Error: URI=null Line=2: schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. Error: URI=null Line=2: cvc-elt.1: Cannot find the declaration of element 'Signature'. class org.apache.xerces.jaxp.DocumentBuilderImpl
When I add an EntityResolver that returns an empty 'DTD', it works:
Is there any other, more clean, solution for this ?
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop