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

Help: transforming "sequence" into "all" content model.

From: Emer Magnani <Emer.Magnani@di3.co.uk>
Date: Wed, 8 May 2002 05:41:41 -0400 (EDT)
Message-ID: <8BE4A2E53E90D3119D1500E018C1F53A3DFDB6@charlie.diexe.co.uk>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

I have an xml schema that defines elements using the "sequence" content
model.  I am trying to modify the schema so that it allows child elements to
appear in any order.  Here is sample element:

the element <myNode> can contain 0 or 1 elements <propertyA> and 0 or 1
elements <propertyB>.  <myNode> can also contain 0 or more elements

	<propertyA>100</propertyA>        [0..1]
	<propertyB>a value</propertyB>   [0..1]
	<myNode>            [0..unbounded]


Currently, I have a schema that uses the "sequence" content model.  This
defines an abstract element "applicationNode" of type "ApplicationNode",
which can recursively contain other "applicationNode" elements:    

<xs:element name="applicationNode" type="sdl:ApplicationNode"
<xs:complexType name="ApplicationNode" abstract="true">
        <xs:element ref="sdl:applicationNode" minOccurs="0"

Other types extend the abstract "ApplicationNode", adding the relevant
property elements to form concrete types (i.e. type MyNode has propertyA,
propertyB.  Type AnotherNode has propertyC, etc.).

Looking at the definition of the "all" content model, it appears to me that
the "all" content model cannot be used to express such a hierarchical
structure.  Is there any work around?

Any help would be appreciated.

Received on Saturday, 11 May 2002 10:38:26 UTC

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