User Guide

Table Of Contents
730 Chapter 30: Creating Skinnable XML Forms
All skins support the same set of CFML tags and tag types, and do a relatively simple
transformation from XML to HTML. For example, they do not support horizontal or vertical
rules.
The ColdFusion MX skin XSL files have several features that you can use when designing and
developing your own transformation. They do the following:
Provide an overall structure and initial templates for implementing custom transformations.
Show how you can handle the various elements in the ColdFusion-generated XML.
Use a structure of included files that can form a template for your XSLT code.
The base XSL files include a separate file, _cfformvalidation.xsl, with complete code for
generating the hidden fields required for ColdFusion onServer validation and the JavaScript for
performing ColdFusion onSubmit and onBlur validation. You can include this file without
modification to do ColdFusion validation in your XSLT template, or you can change it to add
other forms of validation or to change the validation rules.
The base XSL files include files, that implement several form groups, laying out the child tags
and applying a label to the group. These files can serve as templates for implementing
additional form group types or you can expand them to provide more sophisticated horizontal
and vertical form groups.
You can add custom cfformgroup and cfformitem type attributes by including additional
XSL files.
Extending basic.xsl cfformgroup and cfformitem support
The following procedure describes the steps for extending the basic.xsl file to support additional
cfformgroup and cfformitem types. You can use similar procedures to extend other xsl files.
To add support for cfformgroup and cfformitem types to the basic.xsl:
1.
Create an XSL file.
2.
For each type attribute that you want to support, create an xsl:template element to do the
formatting. The element’s
match attribute must have the following format:
match="xf:group[@appearance='type_attribute_name']"
basiccss.xsl A basic form format that arranges form elements using HTML
div and span
tags.
colorname.xsl A basic form format that arranges form elements using a table and applies
a color scheme determined by the colorname to the form. Based on the
basic.xsl file.
_cfformvalidation.xsl Applies ColdFusion MX validation rules. Used by all skins.
_formelements.xsl Transformation rules for form elements except for those defined using
cfformgroup tags. Used by all skins
_group_type.xsl
_group_type_table.xsl
_group_type_css.xsl
Transformation rules for
cfformgroup tags. The tag type attribute is part of
the file name. Files with table in the name are used by basic.xsl and its
derivatives. Files with css in the name are used by basiccss.xsl.
File Description