schema problem 2003-03-05 - By Denis McCarthy
Hi there I'm having a problem with some schema validation rules. I want to allow one of two sequences to be present in an xml document (I'd prefer not to have to use sequences, but I don't think I can use <xsd:all within an xsd:choice tag). However, the following xsd code rule only seems to allow the FIRST sequence to be validated correctly - when I send an xml doc with the second sequence type I get the following SAXParseTypeException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content starting with element 'ELEMENT_3' . The content must match '((("":ELEMENT_1),("":ELEMENT_2))|((("":ELEMENT_1){0-1},("":ELEMENT_3)),("": ELEMENT_4)))'. As far as I can see, the content does match this. Can anyone see a problem with this schema?
<xsd:choice> <xsd:sequence> <xsd:element name="ELEMENT_1" type="TYPE_1"/> <xsd:element name="ELEMENT_2" type="TYPE_2"/> </xsd:sequence> <xsd:sequence> <xsd:element name="ELEMENT_1" type="TYPE_1" minOccurs="0"/> <xsd:element name="ELEMENT_3" type="TYPE_3"/> <xsd:element name="ELEMEMT_4" type="TYPE_4"/> </xsd:sequence> </xsd:choice>
Thanks Denis
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify your system administrator.
This footnote also confirms that this email message has been checked for the presence of computer viruses.
www.fexco.com **********************************************************************
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|