1.

How Can You Define Data Types In Xforms?

Answer»

XML Schema Data Types: XFORMS model supports XML Schema data types. This feature facilitates XForms processor to check the data for correct input values. 

To use XML Schema data types, you must have to use XML Schema namespaces into our NAMESPACE declaration.

For Example:
<html
xmlns:XF="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
After using the XML Schema namespaces, we can add type attributes into our XForms instance elements like this:

For Example:

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

There are some UNSUPPORTED XML Schema datatype in XForms:

  • Duration
  • ENTITY
  • ENTITIES
  • NOTATION

XML Schema Data Types: XForms model supports XML Schema data types. This feature facilitates XForms processor to check the data for correct input values. 

To use XML Schema data types, you must have to use XML Schema namespaces into our namespace declaration.

For Example:
<html
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
After using the XML Schema namespaces, we can add type attributes into our XForms instance elements like this:

For Example:

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

There are some unsupported XML Schema datatype in XForms:



Discussion

No Comment Found