我目前正在阅读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"元素的结合使用。如果我正确理解了元素的定义,它的目的是允许使用模式没有指定的"未知"属性。那么,将"xsd:anyAttribute"限制为具体名称"export",而不是直接指定带有该名称的(可选)属性的目的是什么呢?
这可能只是文档中的一个错误,他们缩进使用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>
anyAttribute元素允许作者使用模式未指定的属性扩展XML文档。
来源:http://www.w3schools.com/schema/el_anyattribute.asp
这里将是你需要知道的一切!你必须像通配符一样看待这个anyAttribute