Adding an <xsl:output> element to your XSL file

You can add an <xsl:output> element to your XSL file using the XSL Output wizard. The <xsl: output> element is used to specify the output you will be using (for example, HTML) and provides you with a way of controlling how the output is created.

The following instructions were written for the Resource perspective, but they will also work in many other perspectives.

Follow these steps to create an <xsl: output> element. The <xsl:output> element will be displayed in a read-only field as it is being created:

  1. Open your XSL file in the XSL editor.

  2. Click the Snippets tab, open the XSL drawer, and then double-click xsl:output element.

  3. The method attribute defines the output format of the XSLT document. In the Method field, select the type of output that will be produced by the XSL file: xml, html, or text. You can also define your own type of output by typing it in the Method field.

  4. The Version attribute provides the version of the output method.

  5. The Encoding list contains descriptions of all the character encoding sets you can select from for your output document. Once you have selected one, the proper name of the character set will be shown in the read-onlyIANA field.

  6. In the Omit XML Declaration field, click yes if you want the XML declaration to be omitted when an output XML file is created. Otherwise, click no.

  7. In the Standalone field, click yes if you want the XML output file to indicate to the XML parser and application that there are not external entity references. Otherwise, click no.

  8. In the Doctype Public field, select the public identifier to be used in the document type declaration for the output HTML document.

  9. In the Doctype System field, select the system identifier to be used in the document type declaration for the output HTML document.

  10. In the CData-section elements field, you can specify any elements in the result tree which should be output using CDATA sections.

  11. In the Indent field, click yes if you want formatting to be used for the output document. If you selectyes, white space will be added to the output document so it looks better. If you do not want any formatting done, click No.

  12. The Media Type attribute presents the media type of the output document. For example, it is text/html for the HTML output method.

  13. ClickFinish.

The <xsl:output> element will be inserted into the appropriate location in the XSL file.

 

Parent topic

Editing XSL files