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

xml schema 中如何定义类似Map的结构

发布时间:2020-12-16 00:39:00 所属栏目:百科 来源:网络整理
导读:利用xs:unique关键字。在xs:element里添加unique节点,任意命名,然后用xs:selector来选择需要唯一的域, xs:field 里指定特定的字段。 例如:定义所有Item里的Key为唯一, xs:complexType xs:sequence minOccurs =" 0 " maxOccurs =" unbounded " xs:eleme
利用xs:unique关键字。在xs:element里添加unique节点,任意命名,然后用xs:selector来选择需要唯一的域, xs:field 里指定特定的字段。


例如:定义所有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 >

(编辑:李大同)

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

    推荐文章
      热点阅读