SchemaFactory - Problem with compiling multiple schemas in same namespace
Till now, I have been able to use the SchemaFactory to validate a single schema file against xml source. No problems.
Now, I have a new schema that is actually broken up into a number of schemas. All belong to same namespace and the main schema "includes" all the others.
So, I have "main.xsd" that inturn includes "1.xsd", ...... "n.xsd".
1) factory.newSchema(new StreamSource(...."main.xsd"));
2) factory.newSchema(sources); // sources is an array of Source
All of them fail with the dreaded
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'someElement' to a(n) 'element declaration' component.
If I were to append all my xsd into main.xsd it works just fine.
The xsd:include tags within main.xsd refers to all the other xsds with just the relevant name. No relative paths or anything like that.
Does anyone have a suggestion/solution to this problem? Any pointers are much appreciated.
I have seen a similar bug at
but no workaround. Is it still an issue or has anyone been able to get around this problem by custom coding LSResourceResolver?