W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2007

Re: XML Schema Element ordering

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Fri, 18 May 2007 10:50:29 +0100
Message-ID: <016b01c79932$84494f80$4200a8c0@Codalogic>
To: "Rich Adili" <Rich.Adili@xata.com>, <xmlschema-dev@w3.org>

In XSD schema, a base and the extra components of a derived type are always 
combined as if they are two components of an xs:sequence (i.e. base 
components first, then derived components).

So I don't think you can change your schema to get what you want.  I'm 
afraid you are going to have to change your boss instead!


Pete Cordell
Tech-Know-Ware Ltd
for XML Schema to C++ data binding visit

----- Original Message ----- 
From: "Rich Adili" <Rich.Adili@xata.com>
To: <xmlschema-dev@w3.org>
Sent: Friday, May 18, 2007 5:10 AM
Subject: XML Schema Element ordering

I suppose this is a noob question but I've not found a good answer yet,

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"

<?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"
<xsd:element ref="ValidationWarning"
<xsd:element name="ValidationError"/>
<xsd:element name="ValidationWarning"/>
<xsd:element name="Upper">
<xsd:extension base="Lower">
<xsd:sequence minOccurs="0"
ref="WildAndCrazy" minOccurs="0"/>
<xsd:element ref="Guy"
<xsd:element name="WildAndCrazy"/>
<xsd:element name="Guy"/>
Received on Friday, 18 May 2007 09:54:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:12 UTC