W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2003

Re: attributeGroups and anyAttribute

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 15 Apr 2003 10:47:21 +0100
To: "Kriegesmann, Peter" <Peter.Kriegesmann@softwareag.com>
Cc: "Schema Dev XML (E-mail)" <xmlschema-dev@w3.org>
Message-ID: <f5bof386qja.fsf@erasmus.inf.ed.ac.uk>

"Kriegesmann, Peter" <Peter.Kriegesmann@softwareag.com> writes:

> Dear friends of the XML schema,
> 
> I have another question regarding xs:anyAttribute.
> Take a look at the schema below:
> 
> <xs:schema targetNamespace = "http://target" xmlns:t = "http://target"
> xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition"
> xmlns:xs = "http://www.w3.org/2001/XMLSchema">
>   <xs:attributeGroup name = "ag1">
>     <xs:attributeGroup ref = "t:ag2"></xs:attributeGroup>
>     <xs:anyAttribute namespace = "http://myNameSpace" processContents =
> "skip"></xs:anyAttribute>
>   </xs:attributeGroup>
>   <xs:attributeGroup name = "ag2">
>     <xs:anyAttribute namespace = "##targetNamespace"></xs:anyAttribute>
>   </xs:attributeGroup>
>   <xs:element name = "E">
>     <xs:complexType>
>       <xs:simpleContent>
>         <xs:extension base = "xs:string">
>           <xs:attributeGroup ref = "t:ag1"></xs:attributeGroup>
>         </xs:extension>
>       </xs:simpleContent>
>     </xs:complexType>
>   </xs:element>
> </xs:schema>
> 
> Is it really valid ?
> Various schema validators, such as IBM SQC, Xerces claim that it is.
> 
> But how can a validator determine, which anyAttribute definition to use for
> element E ?
> Remember that the content model for ..xs:simpleContent/xs:extension is
> 
> (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
> 
> So several anyAttribute definitions are not allowed, there should be no
> difference when attributeGroups are used.
> 
> In this case there are 2 contrary definitions:
> 
> 1. <xs:anyAttribute namespace = "http://myNameSpace" processContents =
> "skip"></xs:anyAttribute>
> 2. <xs:anyAttribute namespace = "##targetNamespace"></xs:anyAttribute>
> 
> It is possible to merge namespace declarations:
> 
> <xs:anyAttribute namespace = "http://myNameSpace ##targetNamespace"/>
> 
> But what to do with processContents "skip" vs. "strict" ??

The REC specifies that the {process contents} of the outer group, in
this case ag1, is used.  See sections 3.6.2 and 3.4.2.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 15 April 2003 05:47:26 GMT

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