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 Graham Mann <gm...@Adobe.COM> on 2001/04/03 13:42:46 UTC

Bug in schema validation

Hi,

When using the SAX2Count example to validate a document the following occurs:

java.lang.ArrayIndexOutOfBoundsException
        at org.apache.xerces.validators.schema.SchemaGrammar.getElementComplexTypeInfo(SchemaGrammar.java:248)
        at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:2759)
        at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:924)
        at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1858)
        at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1234)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:991)
        at sax.SAX2Count.print(SAX2Count.java:148)
        at sax.SAX2Count.main(SAX2Count.java:370)

I've attempted to debug this and have found that the statement 
	return fComplexTypeInfo[chunk][index];
in SchemaGrammar getElementComplexTypeInfo is the culprit. As this function is called, fComplexTypeInfo grows, chunk and index have reasonable values. The exception happens when chunk increases to 9, the array seems to have been overfilled and now seems to be growing from scratch again (as if 8 is the max value for chunk).


Graham Mann
Adobe Systems Europe Ltd.
Tel:    +44 (0)1603 226749



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