Seems you are using Xerces 1.x. Could you upgrade to the latest Xerces
2.2.0? Xerces2 has much better XML Schema support than Xerces1.

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                       
                                                
                      Elmar Seestaedt                                                  
                                                
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]   
                                                
                      >                        cc:                                     
                                                
                                               Subject:  XSD xs:choice schema 
validation error                                         
                      10/09/2002 11:16                                                 
                                                
                      AM                                                               
                                                
                      Please respond to                                                
                                                
                      xerces-j-dev                                                     
                                                
                                                                                       
                                                
                                                                                       
                                                



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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to