W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2008

anyAttribute via attributeGroup refs problem

From: Christian Roth <roth@visualclick.de>
Date: Tue, 11 Nov 2008 11:43:02 +0100
To: "XML Schema Development List" <xmlschema-dev@w3.org>
Message-Id: <20081111104302.1526652321@kriro.de>


during schema development, I stumbled upon the following issue with
anyAttribute elements included via an attributeGroup reference into a

-- instance.xml --

-- schema.xsd --
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="root">
      <xs:attributeGroup ref="ns1-atts"/>
      <xs:attributeGroup ref="ns2-atts"/>
  <xs:attributeGroup name="ns1-atts">
      <xs:anyAttribute namespace="ns1" processContents="skip"/>
  <xs:attributeGroup name="ns2-atts">
      <xs:anyAttribute namespace="ns2" processContents="skip"/>

I expected the given schema to validate the instance document, however I
am presented with the following validation errors:

[Xerces] cvc-complex-type.3.2.2: Attribute 'ns1:attr' is not allowed to
appear in element 'root'.
[Xerces] cvc-complex-type.3.2.2: Attribute 'ns2:attr' is not allowed to
appear in element 'root'.

In my understanding, both of them are allowed via the anyAttribute
element allowing all attributes in the respective namespace name via wildcard.

When I comment out *one* of the attributeGroup references in the "root"
element's content model, the remaining namespace's attribute is no
longer reported as an error, just the namespace's attribute that has
been commented out (as expected).

Is this a problem with my schema file (and if so, why does it validate
both standalone and when performing the actual validation on an
instance) or a bug in the validator? I have tried Xerces and SaxonSA,
both with identical behaviour.

Received on Tuesday, 11 November 2008 10:43:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:48 UTC