Hello Everyone,
I writing a schema where several elements are required, but but may not have any length. For example:
<CurrencyCode>USD</CurrencyCode>
is valid. But this is also valid:
<CurrencyCode/>
I want to create an element decleration that allows for zero length, but when there is data, it validates that it is a certian type. The example above would be a list currency types, but nulls are also allowed. Here's what I currently have in my schema:
<xs:simpleType name="currencyCodeType">
<xs:restriction base="xs:string">
<xs:enumeration value="USD"/>
<xs:enumeration value="usd"/>
</xs:restriction>
</xs:simpleType>
Any input would be appreicated. Thanks.
I writing a schema where several elements are required, but but may not have any length. For example:
<CurrencyCode>USD</CurrencyCode>
is valid. But this is also valid:
<CurrencyCode/>
I want to create an element decleration that allows for zero length, but when there is data, it validates that it is a certian type. The example above would be a list currency types, but nulls are also allowed. Here's what I currently have in my schema:
<xs:simpleType name="currencyCodeType">
<xs:restriction base="xs:string">
<xs:enumeration value="USD"/>
<xs:enumeration value="usd"/>
</xs:restriction>
</xs:simpleType>
Any input would be appreicated. Thanks.