Re: Permit (greedy) conflicting wildcards

Pete Cordell writes:

> More importantly, if you had a schema of the form:
> 
>     <xs:sequence>
>       <xs:element name="given" type="xs:string"/>
>       <xs:any namespace="##any" processContents="lax"
>               minOccurs="0" maxOccurs="unbounded"/>
>       <xs:element name="middle" type="xs:string"/>
>       <xs:any namespace="##any" processContents="lax"
>               minOccurs="0" maxOccurs="unbounded"/>
>       <xs:element name="family" type="xs:string"/>
>     </xs:sequence>
> 
> then I think under the current rules, the following input wouldbe valid:
> 
> <given>abc</given>
> <middle>abs</middle>
> <given>ag</given>
> <family>jhjh</family>
> 
> where the second given is consumed by the wildcard after <middle>.

Yes.  Without wanting to speak for the workgroup, because I don't think 
we've formally decided whether to include this, there is at least some 
chance that Schema 1.1 will have an additional variant of wildcard.  The 
syntax may be along the following lines:

    <xs:sequence>
      <xs:element name="given" type="xs:string"/>
      <xs:any notQName="##defined" processContents="skip"
              minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="middle" type="xs:string"/>
      <xs:any notQName="##defined" processContents="skip"
              minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="family" type="xs:string"/>
    </xs:sequence>

The idea would be that the wildcard would not allow any element for which 
an element declaration existed anywhere in the schema.  So, the second 
"given" in your example below would be rejected.

<given>abc</given>
<middle>abs</middle>
<given>ag</given>
<family>jhjh</family>

The theory is that since you knew about the element <given>, if you wanted 
to allow it after <middle>, you could have said so;  those wildcards are 
for things you >don't< know about.  I suggest that the nuances of this 
feature probably shouldn't be debated until the WG decides whether to 
propose it, and if so in what form.  I just thought you might want to know 
that things like this are under consideration.

Noah

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Monday, 19 March 2007 20:40:49 UTC