gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 01:50:59 26 4
gpt4 key购买 nike

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

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

如您所见,没有为它定义“类型”,我想知道它的默认类型是什么 - anyTypeanySimpleTypestring, 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], if present, otherwise the ·simple ur-type definition·.

然后,你可以找到simple ur-type definitionxsd: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 .

关于XML 架构 : what's the default type of an xsd:attribute?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29845983/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com