Hello,
I'd like to somehow put minIncl and maxIncl around the data I am sending from my producer. One of the requirements is to allow the producer to send an invalid number to the consumer. The consumer will know what the invalid value is based on an INV attribute being set.
Here's a partial schema of what I'm talking about:
<xs:element name="data" minOccurs="0">
<xs:complexType>
<xs:attribute name="V">
<xs:simpleType>
<xs:restriction base="xs:short">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="300"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="U" type="UnitsAttributeType" fixed="/min"/> <xs:attribute name="INV" type="xs:short" fixed="-32768"/> </xs:complexType> </xs:element>
XML the producer would send
<data V="50" U="ms" INV="-32768" />
<data V="60" />
<data V="-32768" />
<data V="-32768" />
<data V="25" />
<data V="100" />
The consumer reads in the data and displays it. If they get an invalid they display an invalid message.
The problem, which can you obviously see by now, is that when the invalid number is sent the parser throws an error that the value (V) is outside the range (0-300). So is there a way to do what I'm trying to do? (i.e. range=0-300, & -32768) or is this a dream and the only way is to make the INV a Boolean and send it every time?
Thanks for the help,
-Nate
I'd like to somehow put minIncl and maxIncl around the data I am sending from my producer. One of the requirements is to allow the producer to send an invalid number to the consumer. The consumer will know what the invalid value is based on an INV attribute being set.
Here's a partial schema of what I'm talking about:
<xs:element name="data" minOccurs="0">
<xs:complexType>
<xs:attribute name="V">
<xs:simpleType>
<xs:restriction base="xs:short">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="300"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="U" type="UnitsAttributeType" fixed="/min"/> <xs:attribute name="INV" type="xs:short" fixed="-32768"/> </xs:complexType> </xs:element>
XML the producer would send
<data V="50" U="ms" INV="-32768" />
<data V="60" />
<data V="-32768" />
<data V="-32768" />
<data V="25" />
<data V="100" />
The consumer reads in the data and displays it. If they get an invalid they display an invalid message.
The problem, which can you obviously see by now, is that when the invalid number is sent the parser throws an error that the value (V) is outside the range (0-300). So is there a way to do what I'm trying to do? (i.e. range=0-300, & -32768) or is this a dream and the only way is to make the INV a Boolean and send it every time?
Thanks for the help,
-Nate