XSLT Formats
Digest
An XSLT Format is an XML document written using the eXtensible Stylesheet Language (XSL). XSLT Formats are used to transform XML documents into other XML documents. Transformations are commonly used to:
- Turn generic XML data into XHTML in order to display it in a web browser
- Add additional formatting and presentation logic
- Re-organize or filter XML data
- Convert from one XML standard to another (XHTML to RSS)
Concept
Uses for XSLT Formats
In Cascade, XSLT Formats are used to transform Block content, structured data content, WYSIWYG XHTML content, or the entire assembled Page's content. Different XSLT Formats allow the same XML to be re-purposed for use on different Pages or for use in different regions of the same Page. For example, if different XSLT Formats were to be applied to identical Templates, the Block content being used by that Template can be styled in different ways to achieve varied looks and feels.
An example XSLT Format would be one that is used to transform the raw structured data XML for a employee's Company Bio page into XHTML for display on a corporate internet.
Assigning XSLT Formats to Regions and Pages
XSLT Formats can be assigned to individual regions at the Page, Configuration Set, or Template level or to entire Pages at the Page, Configuration Set, or Template level.
An XSLT Format assigned to a region will transform the content of the Block assigned to that region. In the case of the Default region, it's possible to assign an XSLT Format without a Block because the Page's structured data XML or the raw WYSIWYG HTML will be used as the content to which the Format is applied.
An XSLT Format assigned at the Page Configuration level of a Page will transform the complete assembled content of that Page after all the region level Formats have been applied.
Inheritance of XSLT Format Assignments

- Page Configuration Sets inherit and can optionally override the XSLT Format assignments of the templates associated with its Page Configurations.
- Pages inherit and can optionally override the XSLT Format assignments of its associated Page Configuration Set
Technical
Further Insight Into XSLT Formats
As mentioned above, XSLT Formats can be assigned to the default regions of Pages using Structured Data Definitions. During the rendering process, the applied XSLT Format is used to transform the user-supplied structured content of the Page.
Example XML document:
By applying the following XSLT Format to the XML document shown above, an HTML/XHTML page will be generated with the heading "Book library:". A table will be created on this page where each row represents a book from the XML document; the first column will display the book's title, the second column will display the book's author, and the third column will display the book's isbn.
Creating XSLT Formats
To create a new XSLT Format:
- In the Home area, select New -> Default -> Format.
-

- Choose the XSLT radio button.
- On the Content pane:
Enter your XSL. -

*Note - In versions 6.4 and newer, the text editor displayed supports syntax highlighting for XSLT Formats. The syntax-highlighting text editor can be turned on/off using the "Advanced Editor" button at the bottom of the editor. (Turning the editor off will turn it off only for that single use of the editor, the change will not persist).
- On the Metadata pane:
Enter any Metadata desired. - On the System pane:
Name - Type in the name of your new Format. Since most Formats are specific to a particular Block, it's often helpful to give them matching names.
Parent Folder - This is where the Format will be stored. It's most useful to store Formats in a central or common location. - Click Submit to save your format.
XSLT Formats must contain valid XML. Characters entered above the XML declaration will cause the system to return a "Content is not allowed before prolog" error message on submit.
XSLT Formats can be edited or deleted by using the Edit or Delete tab, respectively.
Assigning Formats at the Page Level
The Page level is the most specific level in the Block/Format assignment hierarchy in that changes to Block and Format assignments will only affect a single Page. In contrast, changing a Block or Format assignment on a Configuration Set will affect any Page using that Configuration Set.
Assignments that are inherited from Configuration Sets and Templates can be overridden at the Page level with different Blocks/Formats. Overridden assignments at the Page level will place a Page icon next to the particular configuration that was overridden when viewing the Configurations pane of the Page.
Example
Your Site map uses a specific Index Block and unique Format. Rather than setting up a configuration set that will only be used for one Page, you can override the configurations on the actual Page.
How to Override assignments
- Select your Page from the left asset tree, and click Edit tab.
- Click on the Configurations pane for a list of current configurations.
- Select the desired configuration (i.e. HTML or PDF) by clicking the configuration name along the top of the edit form.
- All of the currently defined regions appear, including asset chooser icons to select Blocks and Formats for each region.
- If the selected configuration has Blocks or Formats already assigned to various regions, these will appear alongside the region names.
- To assign a Block or Format to a region, click on the appropriate asset chooser icon and select the desired Block or Format from the pop-up asset menu. Any currently assigned Blocks or Formats may be overridden by clicking on the delete icon or by selecting a new File from the chooser.
- To remove an assignment set at a higher level, check the "No Block" or "No Format" checkbox
- To assign an XSLT Format to the entire Page choose an XSLT Format using the chooser at the top of the configuration.
- Click Submit to save your changes. These assignations will appear only on the current Page.


