![]() |
Previous Top Next |
Creating an XSLT Stylesheet
|
1. | Start XSLT Designer by double clicking on the XSLT Designer icon.
|
![]() |
You are presented with an empty environment.
|
2. | Select the menu option File | Open and open the OrgChart.xsd schema file supplied with XSLT Designer (in the Examples folder).
|
![]() |
The OrgChart schema is the basis of your stylesheet. The elements and attributes it contains are used to create the XSLT stylesheet.
|
3. | Select the menu option File | Assign working XML file... and open the OrgChart.xml file supplied with XSLT Designer.
|
|
This file supplies the XML data through which you preview the XSLT Stylesheet. The file and folder name of the XML file now appear in the title bar.
|
1. | Click on the plus icon of OrgChart element in the schema tree view, to see the sub-elements.
|
2. | Click the Name element and drag it into the Design window. Drop it just after the (contents) text to the left of the root element, end tag.
|
A popup window appears at this point.
|
![]() |
3. | Click the Create Contents option in the popup.
|
![]() |
The start and end tags of the Altova and Name elements are inserted. The (Contents) text, is a placeholder in the Design view and is replaced by XML data in the IE Preview tab.
|
· | Click on the IE Preview tab to display the resulting HTML output of the XSLT stylesheet.
|
In this case the orgchart title is displayed.
|
![]() |
|
· | Click the XSLT stylesheet tab to see the automatically generated XSLT code.
|
![]() |
· | Click the Design[Document] tab, to return to the Design view.
|
The XSLT stylesheet can be saved by selecting the menu command File | Save Generated XSLT file...
|
|
· | Select the menu option File | Save as, and enter a name for the file (XSLT-tutorial). The file name you enter also appears in the title bar.
|
The "Save" command saves the XSLT Designer file as a structure file, or template, (extension *.sps). The .sps file saves all the data visible in the Designer window, as well as the associated working XML and Schema/DTD files.
|
|
Please note:
|
Only template files (all *.sps files) saved from within XSLT Designer, can be edited in XML Spy Document Editor!
|
|