Altova Mailing List Archives


Schema facets and Invalid values

From: stoddarn@----.--- (----)
To: NULL
Date: 11/21/2003 12:19:00 PM
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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.