W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2001

Re: question on important and restriction

From: Joseph M. Reagle Jr. <reagle@w3.org>
Date: Sun, 18 Feb 2001 10:19:26 -0500 (EST)
To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
cc: <xmlschema-dev@w3.org>
Message-ID: <Pine.LNX.4.30.0102180956050.11206-100000@tux.w3.org>
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.


> 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"/>

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

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

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'>
      <element name='Transforms' type='ds:TransformsType' minOccurs='0'/>
    <attribute name='URI' type='uriReference' use='required'/>

The following doesn't work:

     <element name='ds:Transforms' type='ds:TransformsType' minOccurs='0'/>
Received on Sunday, 18 February 2001 10:19:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC