User Guide

Table Of Contents
710 Chapter 30: Creating Skinnable XML Forms
ColdFusion forms and XForms
ColdFusion skinnable forms conform to and extend the W3C XForms specification. This
specification provides an XML syntax for defining interactive forms using a syntax that is
independent of form appearance. ColdFusion MX forms tags include attributes that provide
information that does not correspond directly to the XForms model, such as appearance
information, validation rules, and standard HTML attributes. ColdFusion skinnable forms retain
this information in XForms extensions so that an XSL transformation can use the values to
determine appearance or do other processing.
For more information on XML structure of ColdFusion skinnable forms, see “ColdFusion XML
format” on page 715.
The role of the XSLT skin
An XSLT skin and associated cascading style sheet (CSS) determine how an XML skinnable form
is processed and displayed, as follows:
The XSLT skin tells ColdFusion MX how to process the XML, and typically converts it to
HTML for display. The skin specifies the CSS style sheet to use to format the output.
The CSS style sheet specifies style definitions that determine the appearance of the generated
output.
XSLT skins give you extensive freedom in the generated output. They let you create a custom
appearance for your forms, or even different appearances for different purposes. For example, you
could use the same form in an intranet and on the Internet, and change only the skin to give a
different appearance (or even select different subsets of the form for display). You can also create
skins that process your form for devices, such as wireless mobile devices.
How ColdFusion processes XML skinnable forms
When ColdFusion processes a
cfform tag that specifies XML format and an XSLT skin, it does
the following to the form:
1.
Converts the CFML form tags into an XForms-compliant XML text format and makes it
available in a variable with the same name as the form. ColdFusion ignores in-line text or
HTML tags in the form, and does not pass them to the XML. (It does process HTML
option
tags that are children of a
cfselect tag.)
2.
Applies an XSLT skin to the XML; for example, to convert the form into HTML. The XSLT
file specifies the CSS style sheet.
3.
Returns the resulting, styled, form to the client, such as a user’s browser.
If you omit the
cfform tag skin attribute, ColdFusion MX uses a default skin.
If you specify
skin="none", ColdFusion MX performs the first step, but omits the remaining
steps. Your application must handle the XML version of the form as needed. This technique lets
you specify your own XSL engine, or incorporate the form as part of a larger form.