File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Getting null instance of  XSSchemaSet when the xsd is importing another xsd (XSOM api) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic
Author

Getting null instance of XSSchemaSet when the xsd is importing another xsd (XSOM api)

harbeer kadian
Greenhorn

Joined: Jul 07, 2009
Posts: 12
Hi,
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();
xsomParser.parse(reader);
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.

Please reply, if you have any idea about it.

With Regards
Harbeer kadian
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting null instance of XSSchemaSet when the xsd is importing another xsd (XSOM api)
 
Similar Threads
Getting null instance of WSDLSet when using WOMParser
please help to explain this sentence in the book of MH
XSOMParser throwing out of memory error
Different Schemas using com.sun.tools.xjc.maven2
Getting error when importing inline xsd using XSOM framework