【发布时间】:2018-10-25 14:15:33
【问题描述】:
我想建立一个数据库,其中有一些产品在日本、北美和欧盟的发布日期。 我想让它的方式是,如果某个日期在同一个产品中重复,我可以将区域分组到一个元素中,如下所示:
<releasedate>
<zone zone="JP">30/08/1987</zone>
<zone zone="NA|EU">22/11/1987</zone>
</releasedate>
在架构中我有以下代码:
<xsd:attribute name="zone">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="JP"/>
<xsd:enumeration value="NA"/>
<xsd:enumeration value="EU"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
还尝试制作像“JP|NA|UE”和“(JP|NA|UE){1,3}”这样的模式。没有一个对我有用,我不知道我是否使用了错误的方式来分隔值,但我尝试了管道 |并且属性中还有空格
【问题讨论】:
标签: xml xsd attributes schema restriction