1
私はxsdで作業しています。私のシステムでは、要素<union>
の使用に関する制限があります。以下のコードスニペットです:XSDユニオンの代替品
<xsd: element name = 'CRN' minOccurs = "1">
<xsd: simpleType>
<xsd:union memberTypes = "fps:nonNegativeMax999IntType fps:FullPaymentSubmission_XType"/>
/xsd:simpleType>
<xsd:simpleType name = "FullPaymentSubmission_XType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value = "X"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name = "nonNegativeMax999IntType ">
<xsd:restriction base="xsd:nonNegativeInteger">
<xsd:maxInclusive value = "9999"/>
</xsd:restriction>
</xsd:simpleType>
誰かが私は私のXSDで<union>
の使用を避けることができ、このための代替案を提案することができますしてください?
本当に文字列値 'X'と0から9999までの整数を許可したいのですが、すべてのオプションを列挙する' xs:string'から派生した単一のsimpleTypeを使用するのは難しいです( ' ... ')。たとえば、すべての整数値のコードを生成することができます。あるいは、正規表現を書くこともできます。 –