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:element name='le' type='xs:string'/>

Is the following valid:

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

Many thanks in advance.

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:10 UTC