Search code examples
xmlxsdbpmn

XSD: What does the "name" attribute mean for the "anyAttribute" element?


I am currently reading the specification for BPMN 2.0. In this specification, definitions for the parts of BPMN are given as XML schemas.

In one of those schemas (Table 8.3, p. 54), I stumbled upon a line that does not make sense to me:

<xsd:element name="definitions" type="tDefinitions"/>
  <xsd:complexType name="tDefinitions">
  ...
    <xsd:anyAttribute name="exporter" type="xsd:ID"/>
  ...

What puzzles me is the use of the "name" attribute in conjunction with the "xsd:anyAttribute" element. If I understood the element's definition correctly, its purpose is to allow using "unknown" attributes that are not specified by the schema. So what could be the purpose of restricting "xsd:anyAttribute" to the concrete name "exporter" instead of just directly specifying an (optional) attribute with that name?


Solution

  • It is likely just a mistake in the documentation and they indented to declare an attribute using xsd:attribute.

    xsd:anyAttribute does not have an @name.

    <anyAttribute
      id = ID
      namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )  : ##any
      processContents = (lax | skip | strict) : strict
      {any attributes with non-schema namespace . . .}>
      Content: (annotation?)
    </anyAttribute>