xml schema 中如何定义类似Map的结构
发布时间:2020-12-16 06:01:21 所属栏目:百科 来源:网络整理
导读:利用xs:unique关键字。在xs:element里添加unique节点,任意命名,然后用xs:selector来选择需要唯一的域, xs:field 里指定特定的字段。 例如:定义所有Item里的Key为唯一, xs:complexType xs:sequence minOccurs =" 0 " maxOccurs =" unbounded " xs:eleme
例如:定义所有Item里的Key为唯一,
<
xs:complexType
>
<
xs:sequence
minOccurs
="
0
"
maxOccurs
="
unbounded
">
<
xs:element
name
="
Item
"
type
="
IdentifiersWithSourceItemType
">
</
xs:element
>
</
xs:sequence
>
</
xs:complexType
>
<
xs:unique
name
="
KeyUnique
">
<
xs:selector
xpath
="
.//Key
"/>
<
xs:field
xpath
="
.//NamespaceID
"/>
</
xs:unique
>
<
xs:unique
name
="
KeyUnique2
">
<
xs:selector
xpath
="
.//Key
"/>
<
xs:field
xpath
="
.//UniversalIDType
"/>
<
xs:field
xpath
="
.//Universal/UniversalID
"/>
</
xs:unique
>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ArcGIS Flex Viewer 实现i查询
- c# – Visual Studio 2017输入高CPU(CodeLens)
- 在聚合数据帧后,如何将rownames列表作为值?
- SQLite学习(八) - 虚拟机指令1
- ruby-on-rails – 在Rails表单对象中处理日期的最佳方法是什
- 使用C语言求解扑克牌的顺子及n个骰子的点数问题
- [Swift]LeetCode789. 逃脱阻碍者 | Escape The Ghosts
- postgresql – Postgres错误:重复键值违反唯一约束
- Swift 2.0学习笔记(Day 44)——重写属性
- ruby-on-rails – 构建Rails和Backbone.js模型之间的多对多