Processamento de Documentos Estruturados usando StyleSheets (XSL | CSS | DSSSL)
XSL (através de exemplos)

Composição
•	Sintaxe do XML
•	Fusão de 2 linguagens: DSSSL e CSS
•	Mais uma linguagem de ligação: ECMAScript
•	!Ainda não está na sua forma definitiva!!!
“Hello World”
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hello.xsl"?>
<greeting>Hello world.</greeting>

<?xml version="1.0"?><!--hellohtm.xsl-->
<html xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="1.0">
  <head><title>Greeting</title></head>
  <body><p>Words of greeting:<br/>
    <b><i><u><xsl:value-of select="greeting"/></u></i></b>
    </p></body>
</html>
Usando o SAXON
$saxon hello.xml hello.xsl
<html>
   <head>
      <title>Greeting</title>
   </head>
   <body>
      <p>Words of greeting:
         <br><b><i><u>Hello world. </u></i></b></p>
   </body>
</html>

Data do momento
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:date="http://www.jclark.com/xt/java/java.util.Date">

<xsl:template match="/">
  <html>
    <xsl:if test="function-available('date:to-string') and function-available('date:new')">
      <p><xsl:value-of select="date:to-string(date:new())"/></p>
    </xsl:if>
  </html>
</xsl:template>

</xsl:stylesheet>
Usando o SAXON
$saxon ???.xml date.xsl
<html xmlns:date="http://www.jclark.com/xt/java/java.util.Date">
   <p>Sun Nov 12 23:33:17 GMT+00:00 2000</p>
</html>

Usando “templates”: O Poema
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:date="http://www.jclark.com/xt/java/java.util.Date"
  xmlns="http://www.w3c.org/TR/xhtml1/strict">

<xsl:template match="/">
  <html>
    <xsl:apply-templates/>
    <xsl:if test="function-available('date:to-string') 
                 and function-available('date:new')">
      <p><xsl:value-of select="date:to-string(date:new())"/></p>
    </xsl:if>
    <xsl:apply-templates/>
  </html>
</xsl:template>

<xsl:template match="titulo">
  <h2>
  <xsl:apply-templates/>
  </h2>
</xsl:template>

<xsl:template match="autor">
  <b>
  <xsl:apply-templates/>
  </b><p/>
</xsl:template>

<xsl:template match="data">
  <i>
  <xsl:apply-templates/>
  </i><p/><hr/>
</xsl:template>

<xsl:template match="quadra|terno">
  <p/>
  <xsl:apply-templates/>
  <p/>
</xsl:template>

<xsl:template match="verso">
  <xsl:apply-templates/>
  <br/>
</xsl:template>

<xsl:template match="nome">
  <i>
  <xsl:apply-templates/>
  </i>
</xsl:template>

<xsl:template match="lugar">
  <b>
  <xsl:apply-templates/>
  </b>
</xsl:template>

</xsl:stylesheet>

Criando índices: extracção e reordenação
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3c.org/TR/xhtml1/strict">

<xsl:template match="/">
<html>
  <h1>Lista de Lugares</h1>
  <ol>
    <xsl:for-each select="//lugar">
       <li><xsl:value-of select="."></xsl:value-of></li>
    </xsl:for-each> 
  </ol>
  <h1>Lista de Nomes</h1>
  <ol>
    <xsl:for-each select="//nome">
       <li><xsl:value-of select="."></xsl:value-of></li>
    </xsl:for-each> 
  </ol>
</html>
</xsl:template>
</xsl:stylesheet>
Usando o SAXON
$saxon poema.xml listas.xsl
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:date=http://www.jclark.com/xt/java/java.util.Date
      xmlns="http://www.w3c.org/TR/xhtml1/strict">
<h1>Lista de Lugares</h1>
  <ol>
    <li>Londres</li>
    <li>Londres</li>
    <li>Iorque</li>
  </ol>
<h1>Lista de Nomes</h1>
  <ol>
    <li>Daisy</li>
    <li>Cecily</li>
  </ol>
</html>