Creating and Editing an XSL Stylesheet

See Also 

In the IDE, you can create XSL stylesheets to define transformation rules for your XML documents. You can then perform an XML transformation to transform the data in your document into the output of your choice, such as formatted HTML or a text file.

To create an XSL stylesheet:

  1. From the main window, choose File > New File.
  2. Expand the XML folder and select XSL Stylesheet.
  3. Specify a name and location for the stylesheet and click Finish.

    A new XSL stylesheet node (XSL stylesheet node icon) appears in the Files window.

To edit an XSL stylesheet:

  1. Right-click the XSL stylesheet node in the Files window.
  2. Choose Edit from the pop-up menu.

    The stylesheet opens in the Source Editor.

Using Code Completion in an XSL Stylesheet

The IDE provides basic code completion for XSL stylesheets. Type a left angle bracket (<) to open the code completion box, which contains all of the elements available for code completion. To enter a closing tag for an open element tag, type a left angle bracket and a slash (</).

The IDE provides code completion for all standard XSL elements permitted by the XSLT recommendation. If the XSL stylesheet references a DTD for its output file, you can also use code completion for all elements permitted by the DTD.

For example, if the DTD for your output file contains:

<!ELEMENT folder (folder|file|attr)* >

then the folder, file, and attr elements are available in the code completion box whenever your insertion point is inside a folder element.

To enable code completion based on an output file's DTD:

  1. Reference the DTD in your <xsl:output> element using the doctype-public or doctype-system attributes. If you use the doctype-public attribute, the IDE lets you choose from the public IDs of all your mounted XML catalogs in the code completion box.
  2. Set the format attribute in the <xsl:output> element to the output format permitted by the DTD. For convenience, the html output format automatically implies XHTML as the doctype-public if not overridden.

For more information about XSL transformations, go to:

See Also
Performing an XSL Transformation
Creating an XML Document
Editing an XML Document

Legal Notices