RE: Prohibited Attributes and Attribute Wildcards

both the instance and the schema are valid.  I think this was explained
earlier in the list...
The "prohibited" attributes contribute to "nothing at all" (search the spec
for that phrase).
 
As you point out, "prohibited" makes sense only during restrictions but
otherwise
I don't see any constrain on them as in this case to make the schema
invalid.
 
Anli Shundi

-----Original Message-----
From: Dare Obasanjo [mailto:dareo@microsoft.com]
Sent: Wednesday, April 10, 2002 3:15 PM
To: xmlschema-dev@w3.org
Cc: www-xml-schema-comments@w3.org
Subject: Prohibited Attributes and Attribute Wildcards 


If I have a schema like this:
 
<xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema
<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 16:02:22 UTC