XSD:“name”属性对“anyAttribute”元素意味着什么?

时间:2011-10-13 11:42:24

标签: xml xsd bpmn

我目前正在阅读BPMN 2.0的规范。在本规范中,BPMN部分的定义以XML模式的形式给出。

在其中一个模式中(表8.3,第54页),我偶然发现了一条对我没有意义的行:

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

让我感到困惑的是将“name”属性与“xsd:anyAttribute”元素结合使用。如果我正确理解了元素的definition,其目的是允许使用未由模式指定的“未知”属性。那么将“xsd:anyAttribute”限制为具体名称“exporter”而不是直接指定具有该名称的(可选)属性的目的是什么呢?

2 个答案:

答案 0 :(得分:1)

文档中可能只是一个错误,他们使用xsd:attribute缩进声明属性。

xsd:anyAttribute没有@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>

答案 1 :(得分:0)

anyAttribute元素使作者能够使用未由模式指定的属性扩展XML文档。

来源:http://www.w3schools.com/schema/el_anyattribute.asp

以下是您需要知道的一切!你必须看到这个anyAttribute就像一个通配符。