- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 18 Feb 2001 16:15:29 +0000
- To: "Joseph M. Reagle Jr." <reagle@w3.org>
- Cc: <xmlschema-dev@w3.org>
"Joseph M. Reagle Jr." <reagle@w3.org> writes:
> > 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" />
Right, but nothing lost if you make it global and 'ref' it in that
content model, then your CipherReferenceType above would work.
> The following doesn't work:
>
> <element name='ds:Transforms' type='ds:TransformsType' minOccurs='0'/>
No, you can't insert things into other namespaces that way.
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 Sunday, 18 February 2001 11:15:32 UTC