Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r9975]: trunk / eXist / webapp / xforms / xforms.xml Maximize Restore History

Download this file

xforms.xml    143 lines (126 with data), 5.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="UTF-8"?>
<article>
<articleinfo>
<graphic fileref="../logo.jpg"/>
<productname>Open Source Native XML Database</productname>
<title>XForms Introduction</title>
<author>
<firstname>James</firstname>
<surname>Fuller</surname>
<affiliation>
<address format="linespecific"><email>jim.fuller at webcomposite.com</email></address>
</affiliation>
</author>
</articleinfo>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
<section>
<title>XForms Overview</title>
<para>
eXist now has support for xforms processing via the Alain Couthures
excellent <a href="http://www.agencexml.com">xsltforms</a> processor.
</para>
</section>
<section>
<title>Configuration &amp; Quick Start</title>
<para>
Since eXist v1.3, xsltxforms is built and configured by default with
eXist and should be ready to use. Check out some simple
<a href="examples.xml">examples</a> to check if your eXist is working.
</para>
</section>
<section>
<title>Using xsltform inside of eXist</title>
<para>
Once you are sure xforms is working and installed for your version of
eXist, to use in your xforms just prepend with an XSL PI, pointing to
the /db/xforms/xsltforms/xsltforms.xsl stylesheet.
</para>
<example>
<title>Activate xforms by using xsl PI</title>
<programlisting>
<markup>
<![CDATA[
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:sample="http://www.agencexml.com/sample">
<head>
<title>Hello World in XForms</title>
<xf:model>
<xf:instance>
<sample:data>
<sample:PersonGivenName/>
</sample:data>
</xf:instance>
</xf:model>
</head>
<body>
<div id="xformControl">
<span>
<input type="checkbox"
onclick="$('console').style.display = this.checked? 'block' : 'none';"
checked="checked"/>
Debug
</span>
</div>
<p>Type your first name in the input box. <br/>
If you are running XForms, the output should be displayed in the output area.</p>
<xf:input ref="sample:PersonGivenName" incremental="true">
<xf:label>Please enter your first name: </xf:label>
</xf:input>
<br/>
<xf:output value="concat('Hello ',
sample:PersonGivenName,
'. We hope you like XForms!')">
<xf:label>Output: </xf:label>
</xf:output>
<div id="console"/>
</body>
</html>
]]>
</markup>
</programlisting>
</example>
<para>
xsltforms transforms the XForms xml into an XHTML page with javascript
that can process XForms. As
eXist has support for RESTful interactions the action of saving the XML representation of data provided by XForms can be
as easy as using HTTP PUT method with an action attribute referencing an xml
document in the XML Database. The following example shows an example of this.
</para>
<example>
<title>Example of setting submission to save to eXistdb</title>
<programlisting>
<markup>
<![CDATA[
<xf:submission id="s01" method="put" replace="all" action="/db/xforms/data/xf.xml">
<xf:message level="modeless" ev:event="xforms-submit-error">Submit error.</xf:message>
</xf:submission>
]]>
</markup>
</programlisting>
</example>
</section>
<section>
<title>Additional XForms Resources</title>
<section>
<title>Mailing Lists</title>
<ul>
<li>xsltforms <a href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support">mailing list</a></li>
</ul>
</section>
<section>
<title>XForms Specifications</title>
<ul>
<li><a href="http://www.w3.org/TR/xforms/">XForms v1.0 (Third Edition)</a></li>
</ul>
</section>
<section>
<title>Useful</title>
<ul>
<li><ulink url="http://en.wikibooks.org/wiki/XForms">XForms Wikibook</ulink> is a useful place to learn XForms</li>
<li><a href="http://www.agencexml.com/xforms-tests/testsuite/XForms1.1/Edition1/driverPages/html/" target="_resource">xsltforms coverage of W3C test suite</a></li>
</ul>
</section>
</section>
</article>