Ladmorillo
Programmer
Hi
In my XML i have elements with an attribute named "option" which must contain an integer. But sometimes it is not relevant so the empty value option="" should also be allowed.
Making the attribute itself optional will be confusing for the XML creators.
The type is now:
<xs:simpleType name="option_type">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="7" />
</xs:restriction>
</xs:simpleType>
But how should it be if I want to allow the empty value aswell?
Or is this bad programming, and shold I maybe instead choose to interpret a "0" value as empty?
Anyone?
Ladmorillo
In my XML i have elements with an attribute named "option" which must contain an integer. But sometimes it is not relevant so the empty value option="" should also be allowed.
Making the attribute itself optional will be confusing for the XML creators.
The type is now:
<xs:simpleType name="option_type">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="7" />
</xs:restriction>
</xs:simpleType>
But how should it be if I want to allow the empty value aswell?
Or is this bad programming, and shold I maybe instead choose to interpret a "0" value as empty?
Anyone?
Ladmorillo