I am using Xerces to load schemas that are described in WSDLs.  Below is a representation:
 
<wsdl:definition>
<wsdl:types>
 
<xs:schema targetNamespace="a">
<xs:import namespace="b"/>
</xs:schema>
<xs:schema targetNamespace="b">
<xs:import namespace="a"/>
</xs:schema>
 
</wsdl:types>
</wsdl:definition>
   
Note that there are 2 schemas and they reference each other via import.
 
So here is my problem.  When I load the schema "a" using XMLSchemaLoader.loadGrammar(XMLInputSource), Xerces tells me that it cannot resolve the types that are defined in schema "b".  Likewise, if I try to load schema "b" first, then Xerces cannot resolve types defined in schema "a".
 
If I save these inline schemas in WSDLs to a file and add the correct schemaLocation attribute to the import element, Xerces loads the schemas fine. 
 
My question is: is there a way to load these schemas (without having to save them to file and adding the schemaLocation attribute) in a way that Xerces can resolve the types properly?  I have access to these schemas in memory (as org.w3c.dom.Node).
 
Any help is much appreciated!

--
Jeehong Min

Reply via email to