XForms submission relies on three templates. The first is the submitForm
method="put" indent="true" omit-xml-declaration="false"
template generates the Xforms submission binding, and in this case associates it with an action to output to the file
protocol, via the action
attribute. That requires two global parameters: outputpath
. If, instead of using an XSLT Filter, you transformed your input XML via your own code for calling transformations, you could set the value of these global parameters in your code and then place the output ODF into the zipped file format that OpenOffice uses.
The drawn control for the submission button to be bound to is in the template matching the root node (the first template in the stylesheet). The relevant fragment below shows the drawn element with button positioning:
Finally, here's the template that controls the form button.
Note that in most XForms customization cases in OpenOffice, you can add customization in three places:
- At the XForms namespaced elements
- At the forms namespaced elements
- At the drawn elements inputs
This rule also holds true for customizing the submission button.
A number of customization possibilities exist for extending the generic transformation, including:
- Customization at the level of matching specific input elements or attributes
- Customizing the default behavior
- Customization of the generated OpenOffice styles
- Customizing the default objects generated in the output
Some obvious customizations are to make the XForms Instance output filename dependent on the value of a form field, or to make it submit to an HTTP address using post
, or perhaps to require form fields to be generated only for XML elements or attributes that do not already have a value.