Database Reference
In-Depth Information
However, trying to fully understand what's going on, and all the details (like forms
submission), can be challenging!
eXist has two third-party XForms processors built in that you may choose between:
betterFORM and XSLTForms. They allow you to create pages that contain XForms
logic and have them rendered and executed as the XForms specification describes. To
see this in action, take a look at Example 2-9 , which will be rendered using
betterForm.
Example 2-9. A simple XForms example
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns= "http://www.w3.org/1999/xhtml"
xmlns:ev= "http://www.w3.org/2001/xml-events"
xmlns:xf= "http://www.w3.org/2002/xforms" >
<head>
<title> Hello XForms </title>
<!-- The XForms data model: -->
<xf:model id= "xforms-data-model" >
<xf:submission action= "hello-xforms-submit.xq" id= "submit-id"
method= "post" />
<xf:instance xmlns= "" >
<Data>
<Name/>
<Date/>
</Data>
</xf:instance>
<xf:bind id= "NameBind" nodeset= "/Data/Name" required= "true()"
type= "xs:string" />
<xf:bind id= "DateBind" nodeset= "/Data/Date" required= "true()"
type= "xs:date" />
</xf:model>
</head>
<!-- -->
<body>
<h1> Hello XForms </h1>
<xf:group>
<xf:input bind= "NameBind" >
<xf:label> Name </xf:label>
</xf:input>
<xf:input bind= "DateBind" >
<xf:label> Date </xf:label>
</xf:input>
<xf:submit submission= "submit-id" >
<xf:label> Submit </xf:label>
</xf:submit>
</xf:group>
</body>
</html>
Search WWH ::




Custom Search