You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Burghardt, Andreas (A.)" <ab...@ford.com> on 2002/07/26 11:43:48 UTC

XSD file location problem

Hi,

we are using xerces-J 1.4.4 in a WebSphere 3.02 environment.

The xml we are parsing comes via MQSeries and is therefore a string in memory and not an xml file on the harddrive.

Actually WebSphere tries to find the XSD file under the c:\WINNT\system32 directory:
[Error] :0:0: File "file:///C:/WINNT/system32/VPOOrderMsg.xsd" not found.
java.io.FileNotFoundException: \C:\WINNT\system32\VPOOrderMsg.xsd
	at java.io.FileInputStream.<init>(FileInputStream.java:64)
	
Our xml string begins with
	<?xml version="1.0" encoding="UTF-8"?>
	<VPOOrderMsg xmlns="http://www.MazdaVPO.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.MazdaVPO.org VPOOrderMsg.xsd">

And the code used to parse the XML string:
		DOMParser parser = new DOMParser();
		// set parser features
		parser.setFeature(XERCES_VALIDATION_FEATURE, true);
		parser.setFeature(XERCES_SCHEMA_VALIDATION_FEATURE, true);
		parser.setFeature(XERCES_FULL_SCHEMA_VALIDATION_FEATURE, true);
		parser.setFeature(XERCES_NAMESPACES_FEATURE,true );
		// set the ErrorHandler
		parser.setErrorHandler(this);
		// parse input	
		parser.parse( new org.xml.sax.InputSource(new java.io.StringReader( xmlString ) ) );

So my question ist now:
How can I set the XSD file location so that the parser searches the XSD file in a directory which is for example my web application directory?
Do I have to use a different namespace or 
do I have to set the namespace feature to false and change my xml?

Thank you very much

Andreas

Andreas Burghardt
IBM IT Specialist
ASC-Germany, Imbert building
Tel: x7021008 (int), +49 221 9021008(ext)
e-mail: aburghar@ford.com



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org