Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: How ensure group elements exist and in any order

From: "Michael Kay" <mike@--------.--->
To: "'Gary Fix'" <gary.fix@------.--->, <xmlschema-dev@--.--->
Date: 10/6/2004 5:00:00 PM
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@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Gary Fix
> Sent: 06 October 2004 15:18
> To: xmlschema-dev@w...
> 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>
> 
> 
> 


From ashundi@t... Wed Oct 06 15:22:58 2004
Received: from bart.w3.org ([128.30.52.40])
	by


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent