- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: Tue, 08 Jul 2003 09:09:50 +0100
- To: "Daplyn, Tim" <Tim.Daplyn@eu.sony.com> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>)
- Cc: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
"Daplyn, Tim" <Tim.Daplyn@eu.sony.com> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>) writes:
> The recommendation includes a number of attribute declarations within
> <restriction>s which have only 'name' and 'use' defined e.g.
>
> <xs:attribute name="form" use="prohibited"/>
> (in definition of topLevelAttribute)
>
> Xerces seems to fail this type of redefinition with the following error:
>
> Message: Type of attribute {0} must be validly derived from type of
> attribute in base
>
> This seems to be based on the constraints section
> http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
>
> Please does anyone have a definitive answer as to whether the following xml
> is valid or not?
>
> <complexType name="typeB">
> <attribute name="attr" type="string" use="optional"/>
> </complexType>
> <complexType name="typeR">
> <complexContent>
> <restriction base="typeB">
> <attribute name="attr" use="prohibited"/>
> <!-- Do we _have_ to specify 'type' again?
> -->
> </restriction>
> </complexContent>
> </complexType>
It's valid. The valid derivation constraint cited by Xerces is on
schema _components_, but as the REC says in several places, an xml
element of the form <xs:attribute name="..." use="prohibited"/>
corresponds to no component at all.
ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-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/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 8 July 2003 04:09:52 UTC