Re: question on important and restriction

On 18 Feb 2001, Henry S. Thompson wrote:
> But note this is bogus in another way -- DigestMethod and DigestValue
> are not optional in ds:ReferenceType, so you can't restrict them away
> in any case.

Ok.

> Sorry, I don't see any way to get where you're going, other than
> define a CipherReferenceType as a new type which simply uses
>
>   <element ref="ds:Transforms"/>
>
> and then be sure to put
>
>   <Transforms xmlns="http://www.w3.org/2000/09/xmldsig#">...</Transforms>
>
> in your instance.

I actually started out here, but the trick is we tweaked the dsig schema
to make it easier to use in that we abstracted our types and gave them
names instead of using name+anonymous-context-type. So the following:

  <CipherReference URI="http://example.com/foo">
    <Transforms xmlns="http://www.w3.org/2000/09/xmldsig#">
      <Transform Algorithm="http://example.org/decode"/>
    </Transforms>
  </CipherReference>

  <complexType name='CipherReferenceType'>
    <choice>
      <element ref='ds:Transforms' minOccurs='0'/>
    </choice>
    <attribute name='URI' type='uriReference' use='required'/>
  </complexType>

gives me

<schemaError char='13' line='64' phase='instance'
resource='file:/d:/2tmp/01-17- xmlenc-schema.xsd'>Undefined element
ds{http://www.w3.org/2000/09/xmldsig#}:Transforms referenced from content
model</schemaError> <invalid char='5' code='src-resolve' line='8'
resource='file:/d:/2tmp/test.xml'> undeclared element
{http://www.w3.org/2000/09/xmldsig#}:Transforms</invalid>

I suspect this is because ds:Transforms is not a global element in dsig:

- <complexType name="ReferenceType">
- <sequence>
  <element name="Transforms" type="ds:TransformsType" minOccurs="0" />
  ...


Now the following seems to work but I'd prefer Transforms be in the dsig
namespace instead of having to qualify each transform:

  <complexType name='CipherReferenceType'>
    <choice>
      <element name='Transforms' type='ds:TransformsType' minOccurs='0'/>
    </choice>
    <attribute name='URI' type='uriReference' use='required'/>
  </complexType>

The following doesn't work:

     <element name='ds:Transforms' type='ds:TransformsType' minOccurs='0'/>

Received on Sunday, 18 February 2001 10:19:27 UTC