W9 Lesson 7 - XSLT - Module
W9 Lesson 7 - XSLT - Module
1
XSLT (XML Stylesheet Language Transformation)
This module will discuss another XML-related technology; XSLT. Just like
XPath, it can also extend the function of XML. XSLT is mainly used for
transforming XML documents. This module covers the basics of XSLT and
how it transforms an XML document.
Upon completion of this module, the students should be able to:
1. Define what is XSLT
2. Discuss the purpose of XSLT
3. Identify the syntax of XSLT
What is XSLT?
XSLT Defined
XSLT stands for eXtended Stylesheet Transformation. XSLT is a language
used to transform XML documents into other XML documents, XHTML file, or
any other XML document formats.
Below is an Example of an XML Document
<tr bgcolor="cyan">
<th style="text-align:left">Movie Title</th>
<th style="text-align:left">Director</th>
</tr>
<xsl:for-each select="cinema/movie">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="director"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Course Module
Purpose of XSLT
XSLT uses XPath to navigate through XML documents and to define parts of
the source document that should match one or more predefined templates.
XSLT will transform the matching part of the source document into the result
document when a match is found.
XSLT has its own processor. An XSLT stylesheet is applied on XML documents
to produce a new format.
XSLT Syntax
Declaration
In declaring XSLT documents, we can use the
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Or
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Glossary
XSLT: This stands for eXtended Stylesheet Transformation. XSLT is a
language used to transform XML documents into other XML documents