[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Global attribute vs. simpleType

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Mon, 21 May 2007 18:22:26 +0100
Message-ID: <001201c79bcc$a17a29c0$3b00a8c0@Codalogic>
To: "Rich Adili" <Rich.Adili@xata.com>, <xmlschema-dev@w3.org>
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.