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

attributeGroups and anyAttribute

From: Kriegesmann, Peter <Peter.Kriegesmann@softwareag.com>
Date: Mon, 14 Apr 2003 12:37:27 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106071F9F7B@daemsg02.software-ag.de>
To: "Schema Dev XML (E-mail)" <xmlschema-dev@w3.org>

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" ??

Your help is appreciated,
Best regards,
Peter


Peter Kriegesmann
Phone	 06151-921484
Electronic Business Technologies (QE)				Fax
06151-921612
			
Software AG
http://www.softwareag.com
Uhlandstrasse 12				  
D-64297 Darmstadt
mailto:Peter.Kriegesmann@softwareag.com	
Received on Monday, 14 April 2003 06:37:31 GMT

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