W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

Re: Global attributes

From: Pavani Mukthipudi <Pavani.Mukthipudi@Sun.COM>
Date: Fri, 24 Aug 2001 09:28:44 +0000 (Asia/Calcutta)
Message-Id: <200108240928.OAA29429@blr-root.India.Sun.COM>
To: xmlschema-dev@w3.org

> I have an issue with attributes that are declared under the schema element.
> 
> Given the following global declarations (assuming default namespace is that
> of XML Schema, targetNamespace = "myNamespace", elementFormDefault =
> "qualified", attributeFormDefault = "unqualified":
> 
>     <attribute name = "foo" type = "string"/>
> 
>     <element name = "bar">
>         <complexType>
>             <attribute name = "baz" type = "integer"/>
>         </complexType>
>     </element>
> 
> Is the following markup valid in an instance (assuming default namespace =
> "myNamespace" and xmlns:my = "myNamespace")?
> 
>     <bar baz="27" my:foo="boo"/>
> 
> Since foo was never explicitly declared as an attribute of <bar>, shouldn't
> the validation fail? Or is it the case that a global attribute can be added
> to *any* element whether declared by the element's type or not.

It is invalid.Though the attribute is global,it has to be declared for the 
element which is using it.That is,there should be an attribute declaration in 
element <bar> referring to the attribute 'foo'.

regards,
Pavani

-- 

Pavani Mukthipudi
Sun Microsystems Inc.

Phone: 080 - 2298989   Extn: 87390
Received on Friday, 24 August 2001 05:28:50 GMT

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