XSL (Extensible Style Language) consists of three recommendations from the W3.org. The first one is XPath which is utilized to perform the second, XSLT (EXtensible Style Language - Transform.) The third is XSL-FO (EXtensible Style Language - Formatting Objects.)
XSL is implemented through the use of stylesheets which not only add styling to an XML document, but also addresses the XML elements to which the styling will be applied. These stylesheets apply templates to specific elements as addressed by XPath. A stylesheet is saved with the extension of ".xsl" and is linked to the XML document to which the styling will be applied.
XPath provides a way of addressing the location of the elements in an XML document. These elements are known as nodes. XPath Expressions are also available for more exact path locations.
A simple XPath address:
<EmployeeListing>
<Employee>
<FullName>
<FirstName></FirstName>
<LastName></LastName>
</FullName>
</Employee>
</EmployeeListing>
The absolute XPath address location to the <FirstName> element is:
EmployeeListing/Employee/FullName/FirstName
XPath is utilized to apply the transformation of an XML document into another format such as HTML or WML. This application of XPath is known as XSLT.
XSL-FO (EXtensible Style Language - Formatting Objects) is another specification that contains properties for formatting. At this time, however, there is no browser support for XSL-FO. However, XSL-FO can be viewed using an XSL-FO Processor and the Adobe Reader application.
At this time, until support is available for XSL-FO, CSS (Cascading Style Sheets) is instead utilized for the formatting of the content derived from XML elements. CSS is used for formatting this content for an HTML document. Therefore, it is necessary to create well-formed XHTML within the XSL stylesheet.(See XSL-FO Resources for more information.) |