zoukankan      html  css  js  c++  java
  • xml schema 中如何定义类似Map的结构

    利用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>
  • 相关阅读:
    关于git 拉取的时候一直弹输入密码的问题
    开始日期结束日期check问题
    关于boostrap 排版问题
    【DP_树形DP专题】题单总结
    【DP_背包专题】 背包九讲
    Ubuntu不卸载ibus前提下安装搜狗输入法
    Ubuntu下Java环境配置
    Ubuntu下gcc及g++环境配置
    Ubuntu下VIM(GVIM)环境配置
    PAT 1065 A+B and C (64bit) (20)
  • 原文地址:https://www.cnblogs.com/muzizongheng/p/3170920.html
Copyright © 2011-2022 走看看