Database Reference
In-Depth Information
• eXist is configured such that betterForm will automatically try to render any
XForm content serialized from eXist that was accessed via the /exist/apps URI of
the REST Server. To disable this behavior, see “betterForm” on page 263 .
• If you wish to see what your XForm is doing in XSLTForms, you can add this
processing instruction below the xml-stylesheet processing instruction in your
XForm host document:
<?xsltforms-options debug="yes"?>
This will enable the XSLTForms debugger, after which launching the Profiler can
be a useful tool for viewing the current state of your model instances (via the
built-in Instance Viewer).
• eXist includes an authentication mechanism that is not specific to XForms but
will work for XSLTForms served from eXist. The approach is for you to create an
XQuery that logs users into eXist using xmldb:login . A user must visit this
XQuery before being served the XForm host document from eXist. In this way
the browser is furnished with an HTTP cookie representing the current user's
logged-in session, and any submissions subsequently performed by an XForm
within the same session will have the same access rights to the database as that
user would. With this mechanism, there is no need to encode a username and
password into the resource URI of the xf:submission !
Once you have XSLTForms installed and configured, you can simply store your
XForms host documents into the database (typically as XHTML documents) and
request them via the REST Server.
The source code of a small XForm for capturing details of someone using
XSLTForms is provided at chapters/other-xml-technologies/xslt-forms/test-
xform.xhtml in the book-code Git repository (see “Getting the Source Code” on page
15 ).
To use the example, simply install and configure XSLTForms as described previously
and then store the xslt-forms/test-xform.xhtml document into the /db collection. You
can then display the form in a web browser by calling the document from eXist's
REST Server using a URI like http://localhost:8080/exist/rest/db/test-xform.xhtml?
_xsl=no . If all goes well, you should see the result of the XForm (after being processed
by XSLTForms) rendered in your web browser with the XSLTForms debugger
enabled, as shown in Figure 10-3 .
 
Search WWH ::




Custom Search