XForms Namespace
- Previous Page XForms Model
- Next Page XForms Example
You should use an XForms namespace in HTML and XHTML 1.0.
However, it is very likely that it will no longer be needed in XHTML 2.0.
XForms Namespace
The official XForms namespace is: http://www.w3.org/2002/xforms
If you need to use XForms in HTML (or XHTML 1.0), you must declare all XForms elements through an XForms namespace.
XForms is expected to become a standard component of XHTML 2.0, making the XForms namespace unnecessary.
This example uses the XForms namespace:
<html xmlns:xf="http://www.w3.org/2002/xforms"> <head> <xf:model> <xf:instance> <person> <fname/> <lname/> </person> </xf:instance> <xf:submission id="form1" method="get" action="submit.asp"/> </xf:model> </head> <body> <xf:input ref="fname"> <xf:label>First Name</xf:label></xf:input> <br /> <xf:input ref="lname"> <xf:label>Last Name</xf:label></xf:input> <br /> <br /> <xf:submit submission="form1"> <xf:label>Submit</xf:label></xf:submit> </body> </html>
In this example, I used the xf: prefix for the XForms namespace, but you can freely use any prefix you need.
- Previous Page XForms Model
- Next Page XForms Example