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

Re: ASN.1 => XML Schema questions

From: Di Iorio, Matthew (ISS Atlanta) <MDiIorio@iss.net>
Date: Tue, 26 Jun 2001 10:48:03 -0400 (EDT)
Message-ID: <3FBC19360F5CD511B2CB00306E110B6E203371@msgatl07.iss.net>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
> Not quite -- the above definition is for (a|b)*, but I'm looking for
> definitions of the form (ab|ba)*.

It seems like something that should be really easy to do, but isn't.  The
following is what I have come up with for this case:

    <complexType name='LemurWidget'>
      <choice minOccurs='0' maxOccurs='unbounded'>
        <sequence>
          <element name='foo' type='string' minOccurs='0'
maxOccurs='unbounded'/>
          <element name='bar' type='string' minOccurs='0'
maxOccurs='unbounded'/>
        </sequence>
      </choice>    
    </complexType>

The above snippet should validate the following:

    <bar>frob</bar>
    <foo>ack</foo>
    <foo>qux</foo>
    <bar>eep</bar>
    <foo>quux</foo>
    <bar>oop</bar>

-- 
Matt Di Iorio                Software Engineer
mdiiorio@iss.net         Phone: (404) 236-2748
Internet Security Systems (http://www.iss.net)
Received on Wednesday, 27 June 2001 03:24:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:21 GMT