Re: Global attribute vs. simpleType

Hi Rich,

The global attribute will need to be qualified by the schema namespace in an 
XML instance document, whereas typically attributes belong to no namespace 
at all and hence are defined locally and unqualified.

The global attribute can also be matched as part of an <xs:anyAttribute 
process="strict"/> style wildcard construct.

And a final note, although the schema you've defined is correct, you could 
have defined the global attribute as:

<xs:attribute name="fibber" type="xs:string"/>

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML Schema to C++ data binding visit
 http://www.tech-know-ware.com/lmx/
 http://www.codalogic.com/lmx/
=============================================

----- Original Message ----- 
From: "Rich Adili" <Rich.Adili@xata.com>
To: <xmlschema-dev@w3.org>
Sent: Monday, May 21, 2007 5:31 PM
Subject: Global attribute vs. simpleType


Hi,

Is there a practical difference between a reference to a global
attribute and the use of a simpleType? Only thing I can see is that the
ref forces the name of the attribute.


<xs:element name="myroot">
<xs:complexType>
<xs:attribute name="fooble" type="foober"/>
<xs:attribute ref="fibber"/>
</xs:complexType>
</xs:element>
<xs:attribute name="fibber">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="foober">
<xs:restriction base="xs:string"/>
</xs:simpleType>
Rich Adili

Received on Monday, 21 May 2007 17:22:58 UTC