XML technologies / XML Schema / Data type reference / xs:byte

(Excerpt from “XML Schema” by Eric van der Vlist)

Signed 8-bit integers

Derived from: xs:short

Primitive type: xs:decimal

Known subtypes: none

Facets: xs:enumeration, xs:fractionDigits, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:totalDigits, xs:whiteSpace

Definition

<xs:simpleType name="byte" id="byte">
    <xs:restriction base="xs:short">
        <xs:minInclusive value="-128"/>
        <xs:maxInclusive value="127"/>
    </xs:restriction>
</xs:simpleType>

Description

The value space of xs:byte contains integers from -128 to 127, the signed values fitting in an 8-bit word. The lexical space permits an optional sign and leading zeros before significant digits.

Restrictions

The lexical space does not permit values expressed in other number bases, such as hexadecimal, octal or binary.

Example

Valid byte values include 27, -34, +105 and 0.

Invalid values include 0A, 1524 and INF.

   

 

 

 

back to top