dcsimg
Xerces 2.2.0 xsd parsing problem.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adrian_Szabo
Posted On:   Wednesday, October 23, 2002 11:21 PM

Hello, we start to use Xerces-j parser 2.2.0 and we found the following problem during xml parsing by following scenario: ... // setting xmlReader features m_xmlReader.setFeature( "http://xml.org/sax/features/validation", true ); m_xmlReader.setFeature( "http://xml.org/sax/features/namespaces", true ); m_xmlReader.setFeature( "http://apache.org/xml/features/validation/schema", true ); m_xmlReader.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", false ); m_xmlReader.setProperty( "http://apache.org/xml/properties/schema/external-schemaLocation", System.getProperty("user.dir") + File.   More>>

Hello,

we start to use Xerces-j parser 2.2.0 and we found the following problem during xml parsing by following scenario:
...

			
// setting xmlReader features
m_xmlReader.setFeature( "http://xml.org/sax/features/validation", true );
m_xmlReader.setFeature( "http://xml.org/sax/features/namespaces", true );
m_xmlReader.setFeature( "http://apache.org/xml/features/validation/schema", true );
m_xmlReader.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", false );
m_xmlReader.setProperty( "http://apache.org/xml/properties/schema/external-schemaLocation",
System.getProperty("user.dir") +
File.separator + "schemata" +
File.separator + "files" +
File.separator + "TMCSBase.xsd" );

....


...
// validation content xml String which is held by xmlString
//
/*

			
content of processed xml string:
<?xml version="1.0" encoding="UTF-16"?>
1


content of frq_Site.xsd:

			












































































































































































































content of TMCSBase.xsd :

			


























*/
...
			
// parse the string and validate it
XMLReader xmlReader = getValidator() ;
InputSource inputSource = new InputSource( new StringReader(xmlString) );
xmlReader.parse( inputSource );
timer.stop( "Validation succeeded" ) ;
...


End of listing.

When we're parsing the introduced xml string, following exception occurs:
System Output: **SAXParser Warning**
System Output: SchemaLocation: schemaLocation value = 'S:FREQUENTISTMCSsrcnewBigDragonschematafilesTMCSBase.xsd' must have even number of URIs.
System Error: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'name' to a(n) attribute declaration component.

Please give us the advice, how to solve this failure.
Best regards

   <<Less

Re: Xerces 2.2.0 xsd parsing problem.

Posted By:   Roseanne_Zhang  
Posted On:   Thursday, October 24, 2002 06:02 PM

The reason is obvious, and just in the error message. schemaLocation attribute needs a pair of values. Thanks for put up the error message. I believe nobody will read your long listing of ...



Read here: 5.6 schemaLocation and enjoy!

About | Sitemap | Contact