RE: XML Schema Question

If it weren't for the wildcard, I would suggest using an all group. You
might be able to use one if you required unprocessed elements to be in a
specified AppInfo-like element.

<complexType name="PGPDataType">
  <all>
    <element name="PGPKeyID" type="string" minOccurs="1"/>
    <element name="PGPKeyPacket" type="ds:CryptoBinary" minOccurs="0"/>
    <element name="AppInfo" type="ds:LaxContent" minOccurs="0"/>
  </all>
</complexType>

Jason.

> > -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of Joseph M. Reagle Jr.
> Sent: Tuesday, January 09, 2001 3:16 PM
> To: henry@w3.org; Michael Sperberg-McQueen
> Cc: xmlschema-dev@w3.org; Brian LaMacchia; Donald Eastlake;
> lde008@dma.isg.mot.com
> Subject: XML Schema Question
>
>
> Is there a more elegant schema representation for the semantic
> of, "you can have a sequence of the following, and while I don't
> care which you have (they are all optional) you must have at
> least one of them."
>
> For instance, the following works (though is there a more elegant
> version for the schema?):
>
> <!ELEMENT PGPData ((PGPKeyID, PGPKeyPacket?) | (PGPKeyPacket)
> %PGPData.ANY;) >
>
> -->
>
>    <complexType name="PGPDataType">
>      <choice>
>        <sequence>
>          <element name="PGPKeyID" type="string" minOccurs="1"/>
>          <element name="PGPKeyPacket" type="ds:CryptoBinary"
> minOccurs="0"/>
>          <any namespace="##other" processContents="lax" minOccurs="0"
>           maxOccurs="unbounded"/>
>        </sequence>
>        <sequence>
>          <element name="PGPKeyPacket" type="ds:CryptoBinary"/>
>          <any namespace="##other" processContents="lax" minOccurs="0"
>           maxOccurs="unbounded"/>
>        </sequence>
>      </choice>
>    </complexType>
>
> but it can get ugly for larger structures, or I keep it simple
> and end up permitting more than one instance of each child (wrong)
>
>    <!ELEMENT X509Data ((X509IssuerSerial | X509SKI | X509SubjectName |
>                         X509Certificate)+ | X509CRL %X509.ANY;)>
>
> or permitting empty content (wrong)
>
>    <!ELEMENT X509Data ((X509IssuerSerial?, X509SKI?, X509SubjectName?,
>                         X509Certificate?) | X509CRL %X509.ANY;)>
>
> __
> Joseph Reagle Jr.
> W3C Policy Analyst                mailto:reagle@w3.org
> IETF/W3C XML-Signature Co-Chair   http://www.w3.org/People/Reagle/
>

Received on Wednesday, 10 January 2001 12:26:15 UTC