- From: Michael Kay <mike@saxonica.com>
- Date: Wed, 6 Oct 2004 16:52:13 +0100
- To: "'Gary Fix'" <gary.fix@win-na.com>
- Cc: <xmlschema-dev@w3.org>
(Back on-list: the whole point of having a public list is so that others can
read the questions and answers and add their own observations, like telling
me I'm completely wrong...).
There's a restriction on xsd:all, namely it that it has to make up the
entire content model of a complex type. I think your group definition as
written is OK in itself, but there are restrictions on where and how it can
be used.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Gary Fix [mailto:gary.fix@win-na.com]
> Sent: 06 October 2004 16:07
> To: Michael Kay
> Subject: RE: How ensure group elements exist and in any order
>
> Hi Michael,
> I tried using xsd:all in the group definition and found this
> will NOT work:
> <xsd:group name="VINGroup">
> <xsd:all>
> <xsd:element name="Body" type="xsd:string"/>
> <xsd:element name="Make" type="xsd:string"/>
> <xsd:element name="Model" type="xsd:string"/>
> </xsd:all>
> </xsd:group>
> Should I be placing the "all" somewhere else?
> thanks!
>
> -----Original Message-----
> From: Michael Kay [mailto:mike@saxonica.com]
> Sent: Wednesday, October 06, 2004 8:00 AM
> To: Gary Fix; xmlschema-dev@w3.org
> Subject: RE: How ensure group elements exist and in any order
>
>
> Provided each element can appear at most once, you can do
> this with xsd:all.
> The elements can be optional or mandatory, but not repeated
> (rather like
> attributes, really).
>
> Michael Kay
> http://www.saxonica.com/
>
> > -----Original Message-----
> > From: xmlschema-dev-request@w3.org
> > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Gary Fix
> > Sent: 06 October 2004 15:18
> > To: xmlschema-dev@w3.org
> > Subject: How ensure group elements exist and in any order
> >
> >
> > Hi,
> > When a group of elements ("VINGroup") is present in my xslt
> > file, I want to confirm that all members of the group are
> > present but they may be in any order (sequence)...
> > Is there a way do this in the xsd?
> > This is what I have so far but it forces the VINGroup
> > elements to be in a specific order...
> > thanks in advance,
> > gary...
> >
> > <xsd:element name="Vehicle">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:choice minOccurs="1" maxOccurs="1">
> > <!-- Case #1: VIN &
> > Body/Make/Model Group Supplied -->
> > <xsd:sequence>
> > <xsd:element
> > ref="VehicleIdentificationNumber"/>
> > <xsd:group
> > ref="VINGroup" minOccurs="1" maxOccurs="1"/>
> > </xsd:sequence>
> > <!-- Case #2: VIN Only Supplied -->
> > <xsd:sequence>
> > <xsd:element
> > ref="VehicleIdentificationNumber" minOccurs="1"/>
> > </xsd:sequence>
> > <!-- Case #3: Body/Make/Model
> > Group Only Supplied -->
> > <xsd:sequence>
> > <xsd:group
> > ref="VINGroup" minOccurs="1" maxOccurs="1"/>
> > </xsd:sequence>
> > </xsd:choice>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> > <xsd:group name="VINGroup">
> > <xsd:sequence>
> > <xsd:element name="Body" type="xsd:string"/>
> > <xsd:element name="Make" type="xsd:string"/>
> > <xsd:element name="Model" type="xsd:string"/>
> > </xsd:sequence>
> > </xsd:group>
> >
> >
> >
>
>
Received on Wednesday, 6 October 2004 15:52:17 UTC