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

Cannot do any order and control the maxOccurs.

From: Christopher Birkett <christopherbirkett@yahoo.com>
Date: Tue, 26 Feb 2002 10:12:19 -0500 (EST)
Message-ID: <20020226151139.44967.qmail@web20008.mail.yahoo.com>
To: xmlschema-dev@w3.org
I sent this summary of a major limitation of XML
Schema's to my boss.  If anyone knows how to get
around it please tell me.

XML Schema Limitation:
1.  You cannot specify any order and have some, but
not all, of the elements' frequency greater than one.
    a.  What I mean by this is that presently our
multivalued fields are represented by specifying the
element any many times as needed.
         In this example, if we wanted to say that
<cn> can only appear once and <sw-AppExtension> can
appear as many times as needed, then we would have to
put a restriction on the order the elements come in. 
Meaning, we couldn't put <Extension> before <cn>.
         To almost get around this limitation (if we
want any order and control the frequency) we have 2
         1)  We would have to declare <Extension> as
an XML Schema list type.  The problem with this list
type is that the delimiter is a space, so they don't
recommend using a list for strings.
         <Extension>doc txt</Extension>
         As you can see one of our values for another
field might have a space in it.  We could use our own
delimiter, but then we wouldn't be following the
         2)  We could specify any order and any
frequency for all items (choice maxOccurs="unbounded")
which means they could do this:
                 <cn>Microsoft Word</cn>
             This really isn't what we want because cn
should only be there once (it is not a multivalued

If anyone knows of anyway to get around this please
let me know.


Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
Received on Wednesday, 27 February 2002 03:34:40 UTC

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