XSLTForms/Installing and Testing
Installing and using XSLTForms to support Web-based applications requires two steps:
- Download and install XSLTForms on your server, and point your forms to it as described below.
- If your forms involve submission of form data to the server, you'll need to make arrangements for your server to accept PUT or POST requests.
If you're using the version of XSLTForms included with MarkLogic server or the eXist XML database, both of these tasks are already taken care of for you, as part of the installation and configuration of the XML database. See the documentation!
If you're not using eXist or MarkLogic, you'll need to read the rest of this page.
Installing XSLTForms proper
Prospective users of XSLTForms are sometimes frustrated because they cannot find anything that look like proper installation instructions. (This page is an attempt to correct that situation, for those who find it.) Part of the problem is that some users find it hard to believe that installation of an XForms implementation can be as simple as it is.
First, you must download a copy of XSLTForms. The easiest thing to do is probably to go to the Sourceforge Project Home Page for XSLTForms and look for a download button; clicking on that button will cause your browser to download a ZIP file containing the most recent release package for the software.
When this page was last revised (July 2012), the most recent package was 1.0RC (1.0 release candidate).
Note: earlier releases are still available, including
Unless you have a special need for an older version rather than the current version, however, you should take the latest available package.
Next, you must unzip the ZIP file and get it onto your HTTP server. Remember the location where you put it. (If you do not know how to get files onto your Web server, you will need to consult other sources to learn how to do that, before continuing here.)
Finally, you must add an XML stylesheet instruction to your XForms, which points to the xsltforms.xsl stylesheet in the package you just installed. So if your site is named forms.example.com and you installed XSLTForms in /lib/xsltforms-1.0RC/ and the xsltforms.xsl file is in that directory (do check, sometimes the release packages are wrapped in an extra layer and you'll find the stylesheet one directory level further down), you'll add a line like
<?xml-stylesheet href="http://forms.example.com/lib/xsltforms-1.0RC/xsltforms.xsl" type="text/xsl"?>
to the XHTML+XForms documents you want to deliver with XSLTForms. In practice, you may prefer to use a relative URI rather than an absolute URI (so the stylesheet instruction will read ... href="../../../lib/xsltforms-1.0RC/xsltforms.xsl" ...); that makes it easier to test forms on a test machine before putting them on a production server.
Accepting PUT and POST
Arranging for your server to accept PUT or POST requests from an XForm is an entirely separate matter. In principle, setting the server up to handle such requests is completely independent of your XForms implementation (though in practice some server-side XForms implementations include server-side support for PUT and POST in the package).
This is not the place to go into details, but in general the options available include:
- installation of a WebDAV server (or more commonly configuration of some other server software to support WebDAV requests); possibilities include
- WebDAV support in Apache
- WebDAV / Delta V support in Subversion
- Apache support for WebDAV using Subversion as the file store
- configuration of a generic HTTP server to accept PUT or POST
Because they involve accepting and processing data from potentially unknown (and thus potentially untrustworthy and hostile) clients, PUT and POST unavoidably represent a security risk for your system. In consequence, most Webmasters and system administrators will have firm views on the right way to set things up to manage the risk properly. Users of XForms will need to work with the Webmaster to ensure that things are set up in a way that will let you get your work done and won't expose your site to unavoidable security problems.
XForms can be used as a convenient way to provide more sophisticated user interfaces for Web pages even without submitting data to a server, so for some purposes you may not need to set your server up for PUT and POST.
And for XForms applications you just want to run on your own machine, the support for
file:// URIs in current versions of XSLTForms may make it unnecessary to configure a WebDAV server. (Need description of the Java applet elsewhere in the WikiBook, and need link to that description from here.)