W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2006

Use of global attrbutes

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Tue, 5 Sep 2006 21:27:43 +0100
Message-ID: <003701c6d129$c1a554e0$5000a8c0@RW>
To: <xmlschema-dev@w3.org>

I've found the wording about global attributes confusing for a while and 
thought I'd better clarify it!

If a global attribute is declared in an XSD file, then in an XML instance 
conforming to that XSD is it automatically valid for an instance of that 
global attribute to appear in any instance of a complex type, or is it 
necessary for the XSD to define an attribute use of the global attribute 
within the complex type definition.

i.e. if you have an XSD along the lines of:

<xs:attribute name='x' type='xs:int'/>

<xs:element name='e' type='t'/>

<xs:complexType name='t'>
    <xs:sequence>
        <xs:element name='le' type='xs:string'/>
    </xs:sequence>
</xs:complexType>

Is the following valid:

<e x='123'><le>OK?</le></e>

Many thanks in advance.

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
                         for XML to C++ data binding visit
                         http://www.tech-know-ware.com/lmx
                         (or http://www.xml2cpp.com)
=============================================
Received on Tuesday, 5 September 2006 20:28:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT