Re: Typos in schema definition

On Monday 01 April 2002 05:28, Takeshi Imamura wrote:
> >I haven't tested this or included it in the spec yet.
> >
> > <complexType name='EncryptionMethodType' mixed='true'>
> >   <sequence>
> >     <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
> >     <choice>
> >       <sequence>
> >         <element ref='ds:DigestMethod' minOccurs='0'/> 
> >         <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
> >       </sequence>
> >       <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
> >     </choice>
> >   </sequence>
> >   <attribute name='Algorithm' type='anyURI' use='required'/>
> ></complexType>

Actually, I later tested this with Sun's MSV but it didn't complain [1]. 
Howevever, once I read your email I did test it with XSV (I only wish I 
could get it to work under Linux!) and it did complain of a 
non-deterministic content model, so I'm not sure if MSV supports that 
constraint...? 

[1] java -jar /usr/local/msv/msv.jar xenc-schema.xsd enc-example.xml
start parsing a grammar.
validating enc-example.xml
the document is valid.

> This still seems ambiguous because a ds:DigestMethod element can match
> both <element ref="ds:DigestMethod"> and <any namespace="##other">. 

That surprises me. ds:DigestMethod (by itself) can only match the second 
choice: ##other. If there's a ds:DigestMethod and a OAEPparams then it only 
matches the first choice. Right? Regardless, since your understanding and 
XSV's agree, I'd moved to what you propose below:

> So it would be easier to define this as you say or as follows:
>
> <complexType name='EncryptionMethodType' mixed='true'>
>   <sequence>
>     <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
>     <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
>     <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
>   </sequence>
>   <attribute name='Algorithm' type='anyURI' use='required'/>
> </complexType>

The only change that is required was that in the examples I precede the 
ds:DigestMethod with OAEPparams. However, now that the old ordering is now 
invalid, this will require us to change our namespace.

http://www.w3.org/Encryption/2001/Drafts/xmlenc-core/Overview.html#sec-Schema

Received on Monday, 1 April 2002 17:48:15 UTC