W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2000

Sequences

From: Matthew Merlo <matthew.j.merlo@lmco.com>
Date: Wed, 16 Feb 2000 09:25:49 -0700
To: www-xml-schema-comments@w3.org
Message-id: <38AACF8D.2BAECA7D@lmco.com>

Okay here's an easy question for you all:  I'm in the middle of writing
my first large schema and I'm actually translating it from a DAG
def...fun stuff, I know.  I'm in the process of defining some primitive
element types and I came across some types in the def that are nothing
but sequences of other types.  My question is, how can I accurately (and
efficiently) represent both types?  I want to keep them separate from
each other so that the ending xml schema representation closely mirrors
its DAG counterpart...which may eliminate any chance of efficient
representation but I'll sacrifice that for clarity...for now.

I suppose below would be the quick and dirty way to represent what I
need but there's got to be a cleaner method.

<type name="item-seq">
  <element name = "title" type="string"/>
  <element name="id" type="float"/>
 </type>

<type name="item" source="ns:item-seq" derivedBy="restriction">
  <element name = "title" type = "string" maxOccurs = "1"/>
  <element name="id" type="float" maxOccurs = "1"/>
 </type>

 Can the above be simplified perhaps with a nameless sub type like so:
??

<type name="item" source="ns:item-seq" derivedBy="restriction">
    <type  maxOccurs = "1">
      <element name = "title" type = "string">
      <element name="id" type="float">
    </type>
<type/>

Thanks in advance for any advice.
Received on Wednesday, 16 February 2000 11:36:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:46 GMT