XSLT

Introduction
eXtensible Stylesheet Language (XSLT) Based on a presentation by Daniel Rutten

Brief history

 * Derived from SGML DSSSL(Document Style Semantics and Specification Language or “Dissel”)
 * Describes how to display XML documents
 * Consists of three parts
 * Transforming XML documents (XSLT)
 * Navigating in XML documents (XPath)
 * Formatting XML documents (XSL-FO)

What is XSLT

 * XSLT is the most important part of XSL
 * XSLT transforms an XML document into another XML document
 * XSLT uses XPath to navigate in XML documents
 * XSLT is a W3C Recommendation

Two Golden rules for XSLT

 * All XSLT files are XML files
 * All XSLT files have this root element:

Six useful elements of XSLT

 * &lt;xsl:template> is used to build templates
 * &lt;xsl:value-of> is used to extract values
 * &lt;xsl:for-each> is used to select every element
 * &lt;xsl:sort> is used to sort the output
 * &lt;xsl:if> is used to express conditional test
 * &lt;xsl:choose> is used to express multiple conditional tests (in conjunction with &lt;xsl:when> and &lt;xsl:otherwise>)

Linking XSLT to XML
Add the xml-stylesheet link to the XML file

When shown in a web browser will display

Filter
You can filter what is returned as follows

Adding spaces
As HTML has issues with spaces, you can use &amp;#160; to add a space

will add street and city together separated by comma and space