简体   繁体   English

XML 用于大量可能值的模式枚举

[英]XML Schema enumeration for large set of possible values

I am trying to make an enumerated element that should have all possible regions (local, national, international) in the world (or as a start Canada should be fine) I have been searching for a way to do that but the only way I found was manually inputting all possible values by hand.我正在尝试制作一个枚举元素,它应该具有世界上所有可能的区域(本地、国家、国际)(或者作为开始加拿大应该没问题)我一直在寻找一种方法来做到这一点,但我发现的唯一方法手动输入所有可能的值。

Is there another way to make my simpleType element only accept regions (local, national internationl)?有没有另一种方法可以让我的 simpleType 元素只接受地区(本地、国际)?

<xs:simpleType name="region">
    <xs:restriction base="xs:string">
        <xs:enumeration value="Algoma"/>
        <xs:enumeration value="Brant"/>
        <xs:enumeration value="Bruce"/>
        ...
        <xs:whiteSpace value="collapse"/>
    </xs:restriction>
</xs:simpleType>

Thank you for the help in advance!提前感谢您的帮助!

There has been a lot of work done on this: see the UBL Code List methodology在这方面已经做了很多工作:请参阅 UBL 代码列表方法

https://lists.oasis-open.org/archives/ciq/200704/pdf00000.pdf https://lists.oasis-open.org/archives/ciq/200704/pdf00000.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM