xsd:simpleType

Purpose

Defines a simple type and specifies the constraints and information about the values.

Contained by

Contains

Attributes

Attribute Description Type Default Options Use
name Specifies the name for the element. This attribute is required if the xsd:simpleType element is a child of the xsd:schema element; otherwise the xsd:simpleType element must have no name attribute. xs:QName     optional 

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:si="http://www.volantis.com/xmlns/2006/01/xdime2/si"
  xmlns:xforms="http://www.w3.org/2002/xforms"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <head>
    <title>xsd:maxInclusive</title>
    <xforms:model id="model1">
      <xsd:schema>
        <xsd:simpleType name="myType">
          <xsd:restriction base="otherMyType">
            <xsd:maxInclusive value="51"/>
          </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="otherMyType">
          <xsd:restriction base="xforms:float">
            <xsd:maxInclusive value="512"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:schema>
      <xforms:instance>
        <si:instance>
          <si:item name="number"/>
        </si:instance>
      </xforms:instance>
      <xforms:bind nodeset="number" type="myType"/>
    </xforms:model>
  </head>
  <body>
    <xforms:input model="model1" ref="number">
      <xforms:label>Pick a number:</xforms:label>
    </xforms:input>
  </body>
</html>

Related topics