You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Elmar Seestaedt <es...@gmx.de> on 2002/10/09 17:16:57 UTC

XSD xs:choice schema validation error

Hello,

I figured out a problem with the SAX2 parser when having the features:
http://xml.org/sax/features/validation
http://apache.org/xml/features/validation/schema
set to true.
I have a schema in which I make a choice. In the first possibility there is
an element which is a restriction of type string and a certain value is
allowed. Let´s say it´s "true".
In the second possibility of the choice there is an element with the same
name. Also a restriction of string but with the only allowed value of "false".
Then there is another element which semantically has to be there because the
value of the first element is false.
XMLSpy does not complain about this construct. And I have to have the
dependency of on elements existence to another elements content.
The SAX parser complains with the following exception while having the
second possibility in the parsed xml:
org.xml.sax.SAXParseException: Datatype error: In element 'anrede' : Value
'false' must be one of [true].

	at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1204)

	at
org.apache.xerces.validators.common.XMLValidator.checkContent(XMLValidator.java:4325)

	at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1409)

	at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)

	at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)

	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)

	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1122)

	at heregoesmyclass

Any Ideas... is this a bug or a feature? Or didn´t I read the Spec well
enough?

Elmar

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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