This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Getting null instance of XSSchemaSet when the xsd is importing another xsd (XSOM api)
posted 6 years ago
I used the XSOM api to parse a xsd file.
When my xsd file was not importing any other xsd file, code was working fine
Snippet of code
XSOMParser xsomParser = new XSOMParser();
XSSchemaSet xsSchemaSet = xsomParser.getResult();
XSSchema xsSchema = xsSchemaSet.getSchema(targetNamespace); //targetNamespace attribute //specified in the xsd file
When i used the same snippet of code for a xsd file which is importing other xsd files, i got null pointer exception.
The instance of XSSchemaSet is setting to null.