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 Stefan Wessely <St...@csp-sw.de> on 2002/09/12 15:27:44 UTC

problem with xerces

Hi!

I encountered the following problem, while using xerces j:

Validating a single file works perfect. But when I want to read two xml 
files which are based on two different xsd files, I get a validation error.

I think, xerces wants to validate the second xml file with the first 
xsd. Although its based on the second one.

But I don't know why xerces always uses only the first xsd.

I tried it with a reference to the xsd within the xml file:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="../INSERT-FILENAME-HERE.xsd"


and in java itself:
DOMImplementationAS di = 
(DOMImplementationAS)ASDOMImplementationImpl.getDOMImplementation();
DOMASBuilder parser = di.createDOMASBuilder();

parser.setErrorHandler(new MyDOMErrorHandler());
parser.setFeature(PathConfig.NAMESPACES_FEATURE_ID, true);
parser.setFeature(PathConfig.VALIDATION_FEATURE_ID, true);
parser.setFeature(PathConfig.SCHEMA_VALIDATION_FEATURE_ID, true);
parser.setFeature(PathConfig.SCHEMA_FULL_CHECKING_FEATURE_ID, true);
doc = parser.parseURI(fileName);


Both ways -> the same problem.


Can somebody help me ;-) ?

Thanx,
Stefan


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