- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 06 Nov 2002 13:33:22 +0000
- To: "Nell Golding" <nell_golding@hotmail.com>
- Cc: xmlschema-dev@w3.org
"Nell Golding" <nell_golding@hotmail.com> writes: > I woud like to know, whether I make mistakes in schema definition and > XMLSpy doesn't notice them, or these are bugs of the other tools. > > Here is a part of my schema that causes difficulties: > > <xs:element name="root"> > <xs:complexType> > <xs:choice> > <xs:sequence> > <xs:element name="Ack_Nack" type="xs:string" fixed="ACK"> > <xs:annotation> > <xs:documentation>Acknowledgement</xs:documentation> > </xs:annotation> > </xs:element> > <xs:element name="Reason_Nack" type="leer"/> > </xs:sequence> > <xs:sequence> > <xs:element name="Ack_Nack" type="xs:string" fixed="NACK"> > <xs:annotation> > <xs:documentation>Rejection</xs:documentation> > </xs:annotation> > </xs:element> > <xs:element name="Reason _Nack" type="Explanation_of_Nack" > maxOccurs="unbounded"> > > <xs:annotation> > <xs:documentation>Explanation to the rejection of > the Templates</xs:documentation> > > </xs:annotation> > </xs:element> > </xs:sequence> > </xs:choice> > </xs:complexType> > </xs:element> The above content model violates the Unique Particle Attribution constraint alright -- no way for parser to tell which Ack_Nack element to try to validate with. The DTD equivalent would be ((A_N,R_N)|(A_N,R_N)) which XML 1.0 would reject. You're essentially trying to get a co-occurence constraint here, and W3C XML Schema version 1.0 does not support them -- sorry. ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh W3C Fellow 1999--2002, part-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Wednesday, 6 November 2002 08:33:25 UTC