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 Help for warning: src-import.0: Failed to read imported schema document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Help for warning: src-import.0: Failed to read imported schema document " Watch "Help for warning: src-import.0: Failed to read imported schema document " New topic
Author

Help for warning: src-import.0: Failed to read imported schema document

mike nu
Ranch Hand

Joined: Mar 11, 2001
Posts: 63
Hi there,

I am trying to validate an XML document against a master schema. In my master schema document, I imported some other namespaces by using import like this:

<import namespace="http://www.xyz.com/schema/Test.xsd" schemaLocation= "Test.xsd" />

When I tried to run it, I got warning says:

src-import.0: Failed to read imported schema document 'Test.xsd'.

Does anyone had such experience and know what cause this problem?

Thanks,

Mike
Brian Nielsen
Greenhorn

Joined: Jun 03, 2004
Posts: 3
Hey Mike

Can't answer directly, but are you sure the XSD's are situated in the same folder. For further ideas what platform and parser are you using?

Regards Brian
mike nu
Ranch Hand

Joined: Mar 11, 2001
Posts: 63
Hi Brian,

Thanks for your reply. Here is my code:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", getSchemaURLs());
builder = factory.newDocumentBuilder();

The method getSchemaURLs() will return a File[] for schemas on my local machine.

Mike
 
wood burning stoves
 
subject: Help for warning: src-import.0: Failed to read imported schema document
 
Similar Threads
Soap with attachments
string[] definiton error in xsd file generated with WSAD
simple array in WSAD 5.0 web service. is it possible?
EJB Webservice
Error during Maven "Clean & Build" of project