|
Comment: |
Presumably we need to offer to users the ability to specify if they require float (32bit) or double (64bit).
xsd:decimal http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#decimal
xsd:float http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#float
xsd:double http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#double
xsd:float and xsd:double types allow "INF", "-INF", "NaN", 0 (positive 0), -0 (negative 0).
xsd:float and xsd:double allow scientific notation, xsd:decimal does not.
I'd prefer INF, -INF and NaN to be disallowed for the start and end attributes, and in addition 0 and -0 to also be disallowed for the step attribute.
Trouble is that I can't find an exclude instruction in XML schema to define this.
I also can't find a way of avoiding the duplicated structure in the examples below, in that it would be nice to specify a generic element, e.g.
LoopGeneric, with implementations differing only in their xsd type.
Float:
<xsd:element name="LoopFloat" substitutionGroup="sweep:Function">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Exception" type="xsd:float"
maxOccurs="unbounded" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="start" type="xsd:float" use="required" />
<xsd:attribute name="end" type="xsd:float" use="required" />
<xsd:attribute name="step" type="xsd:float" use="required" />
</xsd:complexType>
</xsd:element>
example:
<LoopFloat start="12.45e-2" end="12.89e-2" step="1e-3" />
12.45e-2 12.55e-2 12.65e-2 12.75e-2 12.85e-2
Double:
<xsd:element name="LoopDouble" substitutionGroup="sweep:Function">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Exception" type="xsd:double"
maxOccurs="unbounded" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup>
<xsd:attribute name="start" type="xsd:double" use="required" />
<xsd:attribute name="end" type="xsd:double" use="required" />
<xsd:attribute name="step" type="xsd:double" use="required" />
</xsd:attributeGroup>
</xsd:complexType>
</xsd:element>
example:
<LoopDouble start="0.001" end="0.010" step="0.001">
<Exception>0.003</Exception>
</LoopDouble>
0.001, 0.002, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.010
|