XML 架构:xsd:attribute 的默认类型是什么?

XML Schema: what's the default type of an xsd:attribute?

在 EBUCore 模式 (http://en.wikipedia.org/wiki/Metadata_standards) 中有一个名为 'version' 的属性定义为

<attribute name="version" default="1.5">
  <annotation>
    <documentation> The version of the schema for e.g. OAI management.</documentation>
  </annotation>
</attribute>

如您所见,没有为它定义 'type',我想知道它的默认类型是什么 - anyTypeanySimpleTypestringfloat, double, ...

W3C 规范 (http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#section-Built-in-Simple-Type-Definition) 有点难通过:

The ·simple ur-type definition· is considered to have an unconstrained lexical space, and a value space consisting of the union of the value spaces of all the built-in primitive datatypes and the set of all lists of all members of the value spaces of all the built-in primitive datatypes.

所以,也许有人可以告诉我,将该属性映射到哪种类型?

属性默认类型

XSD中XML属性的类型默认为xsd:anySimpleType.

哪里这么说的?

3.2.2 XML Representation of Attribute Declaration Schema Components

The simple type definition corresponding to the element information item in the [children], if present, otherwise the simple type definition ·resolved· to by the ·actual value· of the type [attribute], if present, otherwise the ·simple ur-type definition·.

然后,你可以找到简单的ur类型定义xsd:anySimpleType之间的联系 here:

[Definition:] The simple ur-type definition is a special restriction of the ur-type definition whose name is anySimpleType in the XML Schema namespace. anySimpleType can be considered as the ·base type· of all ·primitive· datatypes.

是的,人们希望它更容易确定。

元素默认类型

XML元素的类型XSD中的默认为ur-anytype.