XML Schema:什么是xsd:属性的默认类型?

在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’,我想知道,它的认类型是什么 – anyType,anySimpleType,string,float,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],otherwise the ·simple ur-type deFinitio.

然后,您可以找到简单ur-type定义和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.

是的,人们原本希望它更容易确定.

元素认类型

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

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念