W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

Problem with XML Schema resource location in default handler

From: <Kalyan.Dasika@silverline.com>
Date: Tue, 25 Jun 2002 22:04:20 -0400 (EDT)
Message-ID: <7415BAE16406EA438981D4A98DE0AE350C02FA@phexch01.silverline.com>
To: <xmlschema-dev@w3.org>
I have been using XML schema for validating XML documents in one of our applications and i've been using the xercer java parser 2.0.1

It seems to be doing its job well if i specify the following in the instance document..

<TESTDATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 



But i've been trying to specifiy the property for locating the schema in a class that implements the default handler,

<TESTDATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">



code snippet:

	XMLReader xr = XMLReaderFactory.createXMLReader();
	//set the following properties

	//set the following features
            xr.setFeature(NAMESPACES_FEATURE_ID, true);            
            xr.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, true);           
            xr.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true); 
            xr.setFeature(VALIDATION_FEATURE_ID, true);
            xr.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);                  
            xr.setFeature(DYNAMIC_VALIDATION_FEATURE_ID, true);
	xr.parse( new InputSource(fileInputStream) ); //pass the XML file input stream

The handler just parses the XML file.. but the rules are not validated. But the validations are done if i specify the schema location in the instance document.

Could any one please let me know if i'm missing anything..

- Kalyan
Received on Wednesday, 26 June 2002 03:54:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC