XSLT Elements

Core XSLT 1.0 elements for transforming XML into HTML, XML, or plain text. XSLT is a declarative, template-based transformation language where rules fire based on node matching.

Syntax

xml-fundamentals
<xsl:template match="XPath">
<xsl:apply-templates select="XPath"/>
<xsl:value-of select="XPath"/>
<xsl:for-each select="XPath">
<xsl:if test="condition">
<xsl:choose>/<xsl:when>/<xsl:otherwise>
<xsl:sort select="XPath" order="ascending|descending"/>

Example

xml-fundamentals
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <ul>
      <xsl:apply-templates select="catalog/book"/>
    </ul>
  </xsl:template>

  <xsl:template match="book">
    <li><xsl:value-of select="title"/></li>
  </xsl:template>
</xsl:stylesheet>