xml spy
Previous  Top  Next
Creating an XSLT Stylesheet

Starting XSLT designer:
1.Start XSLT Designer by double clicking on the XSLT Designer icon.  
ic_designer  
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).  

tut_topic1_p1  

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.  

Inserting a schema element into the Design view:
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.  

mnu_cxt_create_struct  

3.Click the Create Contents option in the popup.  

tut_topic1_p2  

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.  

Previewing the XSLT stylesheet:

·Click on the IE Preview tab to display the resulting HTML output of the XSLT stylesheet.  
In this case the orgchart title is displayed.  
tut_topic1_p3  
 
To view the XSLT stylesheet code:
·Click the XSLT stylesheet tab to see the automatically generated XSLT code.  

tut_topic1_p4  

·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...  
 
Saving XSLT Designer files:
·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!  

Previous  Top  Next

⌐ 2002 Altova