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

Re: mixing orderer and unordered elements

From: Rick Jelliffe <ricko@topologi.com>
Date: Thu, 13 Jun 2002 04:44:01 +1000
Message-ID: <042001c21241$1ef0d8b0$4bc8a8c0@AlletteSystems.com>
To: <xmlschema-dev@w3.org>

Torsten Curdt <tcurdt@dff.st> wrote:
 I am trying to have a mixture of ordered and unordered elements:


For these kind of complex requirements, it may be easier to layer
rather than attempt baroque content models:

  <xs:element name="root">
          <!-- All in the family -->
          <xs:element name="seq1"/>
          <xs:element name="seq2"/>
          <xs:element name="unordered1"/>
          <xs:element name="unordered2"/>
            <pattern xmlns="http://www.ascc.net/xml/schematron">
                   <rule context="root">
                       <!-- Who's on first -->
                        <assert test="*[1][self::seq1]" />
                        <assert test="*[2][self::seq2]" />

with the proviso that ifever  "root" is used as a local element name
with a different content model you will need to factor that in
(such as   <rule context="root[not(parent::fred)]">  
which breaks encapsulation.

Rick Jelliffe
Received on Wednesday, 12 June 2002 14:31:16 UTC

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