Re: xmlspy: does ##other apply to only subsequent target ns

"Joseph M. Reagle Jr." <reagle@w3.org> writes:

> At 15:47 2/21/2001 +0000, Henry S. Thompson wrote:
> >Sure, you can do that:  all you have to do, since RetrievalMethodType
> >is not used anywhere else, is just redefine it to not have the Type
> >attribute.  This has to be done in a stub document which is in the
> >dsig namespace.
> 
> Ok, I tried this [1, where "prime" is the stub] and still get:
> >Detected during instance validation
> >file:/i:/2web/policy/stub-sigenc/01-19-xmlenc-schema.xsd:29:15: Error: non-deterministic content model for type KeyInfoType: {Wildcard: ##other}/{http://www.w3.org/2001/02/xmlenc#}:KeyRetrievalMethod
> 
>  
> [1] http://policy.w3.org/stub-sigenc/prime.xsd
> <schema xmlns="http://www.w3.org/2000/10/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1" elementFormDefault="qualified" attributeFormDefault="unqualified"> 
>  <redefine schemaLocation="xmldsig-core-schema.xsd"> 
>   <complexType name="RetrievalMethodType"> 
>   <complexContent> 
>     <restriction base="ds:RetrievalMethodType"> 
>      <sequence> 
>       <element name="Transforms" type="ds:TransformsType" minOccurs="0" /> 
>      </sequence> 
>      <attribute name="URI" type="uriReference" /> 
>      <attribute name="Type" type="uriReference" use="fixed"    
>      value="http://www.w3.org/2001/02/xmlenc#EncryptedKey" /> 
>     </restriction> 
>    </complexContent> 
>   </complexType> 
>  </redefine> 
> </schema>
> 
> http://policy.w3.org/stub-sigenc/01-19-xmlenc-schema.xsd
> ...
> <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="prime.xsd" /> 

So down to here is fine, and you could just stop, and use (the
indirectly redefined) ds:KeyRetrievalMethod.  But there would be no
signal in the instance, e.g enc:KeyRetrievalMethod, that there was a change.

> <complexType name="KeyInfoType"> 
>  <complexContent> 
>   <extension base="ds:KeyInfoType"> 
>    <sequence> 
>     <element ref="xenc:KeyRetrievalMethod" minOccurs="0" /> 
>    </sequence> 
>   </extension> 
>  </complexContent> 
> </complexType> 

You don't need this, and in any case it doesn't render ds:KeyInfoType OK.

> <element name="KeyRetrievalMethod" type="ds:RetrievalMethodType" substitutionGroup="ds:RetrievalMethod" /> 

But this, because of the <any namespace='##other'/> in
ds:KeyInfoType, does indeed render ds:KeyInfoType ambiguous.

Sigh.

So the only fully clean approachs I can see are to

 a) Forget the substitution group, and redefine ds:KeyInfoType to have
    xenc:KeyRetrievalMethod in place of the <any namespace="##other"/>.
    This has the disadvantage of closing off futher ad-hoc inclusions.

 b) redefine ds:KeyInfoType to get rid of the <any> altogether, and
    use the substitutionGroup route to get xenc:KeyRetrievalMethod in there.
    This has the same disadvantage as the above, _and_ requires
    xmldsig-core-schema.xsd to be change to use a ref= to
    ds:KeyRetrievalMethod.

Take home message: In flexible content models where ambiguity issues
may arise, _either_ use global element refs to facilitate constrained
re-use via substitution groups, _or_ include a wildcard to allow
unconstrained re-use.  You can't have both, until v1.1 where we
provide a richer wildcard functionality.

Given that that will come (so that you can take option (a) above and
still allow a restricted <any> which doesn't conflict with ds: or
xenc:), I think I'd recommend option (a).

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Friday, 23 February 2001 06:23:29 UTC