- From: Dare Obasanjo <dareo@microsoft.com>
- Date: Wed, 10 Apr 2002 12:14:47 -0700
- To: <xmlschema-dev@w3.org>
- Cc: <www-xml-schema-comments@w3.org>
- Message-ID: <8BD7226E07DDFF49AF5EF4030ACE0B7E05573C7C@red-msg-06.redmond.corp.microsoft.com>
If I have a schema like this: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified"> <xs:element name="root"> <xs:complexType> <xs:attribute name="attr" use="prohibited"/> <xs:anyAttribute namespace="##local" processContents="lax"/> </xs:complexType> </xs:element> </xs:schema> And an instance like this: <root attr="123"/> Should the attribute that is marked as use="prohibited" be rejected according the W3C XML Schema recommendation? My initial instinct is that the instance document is invalid but this excerpt from the W3C XML Schema Structures recommendation makes it seem like the XML Schema WG explicitly wants the documents like those in the above scenario to be valid. "NOTE: The only substantive function of the value prohibited for the use attribute of an <attribute> is in establishing the correspondence between a complex type defined by restriction and its XML representation. It serves to prevent inheritance of an identically named attribute use from the {base type definition}. Such an <attribute> does not correspond to any component, and hence there is no interaction with either explicit or inherited wildcards in the operation of Complex Type Definition Validation Rules (§3.4.4) or Constraints on Complex Type Definition Schema Components (§3.4.6). " This makes it seem that prohibited is only designed to be used for removing <attribute>'s from a complexType that has been derived by restriction even though this same attribute could then be reinserted via an attribute wildcard. I'm not sure my interpretation is accurate or not but if it is I suspect a bug in the recommendation. -- PITHY WORDS OF WISDOM Drive defensively--buy a tank. This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
Received on Wednesday, 10 April 2002 15:15:21 UTC