Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XML Schema Element ordering

From: "Rich Adili" <Rich.Adili@----.--->
To: <xmlschema-dev@--.--->
Date: 5/17/2007 6:11:00 PM
I suppose this is a noob question but I've not found a good answer yet,
so...

This xml will not validate against the enclosed schema unless I reorder
the four text elements to match. How can I adjust the schema to allow
mix-and-match ordering of the elements without breaking the "Upper" and
"Lower" set relationships? I've heard the lecture that node order
shouldn't matter in XML but my boss is funny about giving orders and
having them followed...

<?xml version="1.0" encoding="UTF-8"?>
<Upper xsi:noNamespaceSchemaLocation="junk.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<ValidationError>text</ValidationError>
	<WildAndCrazy>text</WildAndCrazy>
	<ValidationWarning>text</ValidationWarning>
	<Guy>text</Guy>
</Upper>

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:complexType name="Lower" abstract="true">
		<xsd:sequence minOccurs="0" maxOccurs="unbounded">
			<xsd:element ref="ValidationError"
minOccurs="0"/>
			<xsd:element ref="ValidationWarning"
minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ValidationError"/>
	<xsd:element name="ValidationWarning"/>
	<xsd:element name="Upper">
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="Lower">
					<xsd:sequence minOccurs="0"
maxOccurs="unbounded">
						<xsd:element
ref="WildAndCrazy" minOccurs="0"/>
						<xsd:element ref="Guy"
minOccurs="0"/>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WildAndCrazy"/>
	<xsd:element name="Guy"/>
</xsd:schema>



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