加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 23:12:24 所属栏目:百科 来源:网络整理
导读:在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 /annotatio
在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 definition·.

然后,您可以找到简单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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读