468,101 Members | 1,539 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,101 developers. It's quick & easy.

How represent 24-bit data types in XML Schema? Limits?

I have data from an embedded device that I want to represent as an XML
schema. Each data sample in the device's data log consists of a 24-bit
pressure value plus a 1 byte temperature value. I am an XML schema newbie.

A 24-bit unsigned integer value has a range of 0 to 8388607. Is there some
way I can represent this in an XML schema?

Here is what the data looks like:

<DataLog>
<Sample>
<Pressure>122456></Pressure>
<Temperature>23</Temperature>
</Sample>
<Sample>
<Pressure>132245></Pressure>
<Temperature>27</Temperature>
</Sample>
<Sample>
<Pressure>172245></Pressure>
<Temperature>32</Temperature>
</Sample>
</DataLog>

What would a logical XML schema look like?

<xs:complexType name="LogData" >
<xs:complexType name="Sample" >
<xs:element name="Pressure" type="xs:???">
<xs:element name="Temperature" type="xs:unsignedByte">
</xs:complexType>
</xs:complexType>

Thanks in advance for any tips or suggestions,

-Ed
Nov 11 '05 #1
1 1757
Ed Sutton wrote:
I have data from an embedded device that I want to represent as an XML
schema. Each data sample in the device's data log consists of a 24-bit
pressure value plus a 1 byte temperature value. I am an XML schema newbie.

A 24-bit unsigned integer value has a range of 0 to 8388607. Is there some
way I can represent this in an XML schema?


<xs:element name="Pressure">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="8388607"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by marty | last post: by
22 posts views Thread by Fred Ma | last post: by
2 posts views Thread by guoqi zheng | last post: by
6 posts views Thread by mrdoommaster | last post: by
1 post views Thread by steve | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.