XForms Data Types

« Previous Chapter Next Chapter »

The XForms model supports XML Schema data types.

XML Schema Data Types

The XForms model supports XML Schema data types. This feature allows the XForms processor to check the data for correct input values.

You can learn more about XML Schema in our XML Schema tutorial.

To use XML Schema data types, you must add the XML Schema namespaces to your namespace declaration like this:


After adding the XML Schema namespaces, you can add type attributes to your XForms instance elements like this:

  <person xmlns="">
    <fname xsi:type="xsd:string"/>
    <lname xsi:type="xsd:string"/>
    <born xsi:type="xsd:date"/>
    <size xsi:type="xsd:integer"/>

XForms supports all XML Schema data types, except:

  • duration

For a complete reference to XForms data types:

Complete XForms Data Type Reference

Binding Datatypes

In XForms you can also use the <bind> element to associate data types with instance data:

<xf:bind nodeset="/person/size" type="xsd:integer"/>

« Previous Chapter Next Chapter »

Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!