Hello,
I want to access the schema grammars while getting SAX events from a
SAXParser. I currently access these grammars by providing my own
XMLGrammarPool to the parser, which then caches the grammars in there
and lets me access them. Is there another way or a better/preferred way ?
The problem I have is that in XMLSchemaValidator the grammars are only
cached in the XMLGrammarPool in handleEndElement() so for those declared
at the root element: at the end of the document. Which makes them
unaccessible for me during the parsing process.
I have found that attempting to cache them in XMLSchemaValidator.findSchema()
solves my problem. Is this acceptable ?
Here is my patch in case you appreciate the feature.
--
# Stef Epardaud, # Teachers have potentially more power than military,
# Java Defeater # the former can teach us how to not need the latter.
# Earth # Lunatech Research,
# Solar System # soon we'll quit researching and start finding...
Index: src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
===================================================================
RCS file:
/home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
retrieving revision 1.137
diff -r1.137 XMLSchemaValidator.java
2174a2175
>
2362a2364,2366
> if(grammar != null && fGrammarPool != null) {
> fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,
> fGrammarBucket.getGrammars());
> }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]