Re: <annotation> not allowed in <component ref="..."/> ?

Simon.Cox@csiro.au writes:

> I wonder if anyone can verify my interpretation of a Xerces schema
> validation error.  
> 
> Our schema has type definitions containing components like:
> 
>   <complexType name="DictionaryEntryType">
>     <sequence>
>     ...
>     </sequence>
>     <attributeGroup ref="gml:AssociationAttributeGroup">
>       <annotation>
>         <documentation>Some text</documentation>
>       </annotation>
>     </attributeGroup>
>   </complexType>
> 
> Xerces complains:
> 
> "Error at file C:\dev\schemas\src\gml/base/dictionary.xsd, line 78, char 57
>   Message: A <attributeGroup> declaration that has a ref attribute, cannot
> have child content."
> 
> In http://www.w3.org/TR/xmlschema-1/#cAttribute_Group_Definitions I find the
> following:
> 
> "The example above illustrates a pattern which recurs in the XML
> representation of schemas: The same element, in this case attributeGroup,
> serves both to define and to incorporate by reference. In the first case the
> name attribute is required, in the second the ref attribute is required, and
> the element must be empty."  
> 
> This appears to imply that it is not allowed to have an <annotation> child
> in a declaration (particle-use?) that uses the ref="..." form, even though
> an <annotation> does not contribute to the infoset.  Is this correct?  Or is
> Xerces being a little over-zealous??

I'd say Xerces is being over-zealous, for at least three reasons:

1) There is no explicit statement in Attribute Group Representation OK
ruling <annotation> out;

2) In the parallel case for e.g. <element ref="...">, the relevant
constraint explicitly allows <annotation>:

        "2.2 If ref is present, then all of <complexType>, . . . must
        be absent, i.e. only minOccurs, maxOccurs, id are allowed in
        addition to ref, along with <annotation>."

3) The Schema for Schemas has a type specifically for this case,
called attributeGroupRef, and it allows annotation children.

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, 25 March 2003 04:12:22 UTC