XML Tutorial/XML Schema/int — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 11:26, 26 мая 2010

specifies a sequence of zero to nine digits

   <source lang="xml">

<xsd:element name="ninedigits">

 <xsd:simpleType>
  <xsd:restriction base="xsd:int">
   <xsd:pattern value="\d{0,9}"/>
  </xsd:restriction>
 </xsd:simpleType>

</xsd:element>

<ninedigits>217748364</ninedigits></source>


The int data type is derived from the long type.

   <source lang="xml">

The value space is integer values from ?47483648 up to and including 2147483647. The lexical space is a finite-length sequence of decimal digits with an optional leading - or +.

<xsd:element name="ninedigits">

 <xsd:simpleType>
  <xsd:restriction base="xsd:int">
   <xsd:totalDigits value="9"/>
  </xsd:restriction>
 </xsd:simpleType>

</xsd:element>

<ninedigits>217748364</ninedigits></source>