V
Vegard Bakke
I would like to specicy a type that restricts decimal numbers to a
maximum of 15+2 digits. (Up to 15 digits before the decimal point and
2 after.)
I'll use an example of 3+2 for simplicity.
<xs:simpleType name="AmountType">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
<xs:totalDigits value="5"/>
</xs:restriction>
</xs:simpleType>
This will allow <A>999.99</A> and will prohibit <A>999.999</A> and
<A>9999.99</A>.
However it also allows <A>9999.9</A> and <A>99999</A> (XMLSpy 2004),
which is not what I want.
Am I forced to use maxExclusive=1000? Which means, is:
<xs:fractionDigits value="2"/>
<xs:maxExclusive value="1000000000000000"/>
the only way to restrict a decimal data type to 15+2?
It is quite error prone and hard to read (count).
Cheers,
Ve
maximum of 15+2 digits. (Up to 15 digits before the decimal point and
2 after.)
I'll use an example of 3+2 for simplicity.
<xs:simpleType name="AmountType">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
<xs:totalDigits value="5"/>
</xs:restriction>
</xs:simpleType>
This will allow <A>999.99</A> and will prohibit <A>999.999</A> and
<A>9999.99</A>.
However it also allows <A>9999.9</A> and <A>99999</A> (XMLSpy 2004),
which is not what I want.
Am I forced to use maxExclusive=1000? Which means, is:
<xs:fractionDigits value="2"/>
<xs:maxExclusive value="1000000000000000"/>
the only way to restrict a decimal data type to 15+2?
It is quite error prone and hard to read (count).
Cheers,
Ve