All pastes #128334 Raw Edit

Mine

public text v1 · immutable
#128334 ·published 2006-08-12 22:14 UTC
rendered paste body
xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/" name="main">
<xsl:apply-templates select="link" />
<xsl:apply-templates select="table" />
</xsl:template>

<xsl:template match="/link" name="link">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:value-of select="." />
</a>
</xsl:template>

<xsl:template match="/table" name="table">
<table>
  <xsl:for-each select="row">
  <tr>
  <xsl:for-each select="cell">
    <td><xsl:copy-of select="." /></td>
  </xsl:for-each>
  </tr>
  </xsl:for-each>
</table>
</xsl:template>


</xsl:stylesheet>

xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/entries">
<table>
<xsl:for-each select="entry">
<row>
  <cell>
    <link><xsl:attribute name="href"><xsl:text>/forum/</xsl:text><xsl:value-of select="name" /></xsl:attribute>
    <xsl:value-of select="name" />
    </link>
  </cell>
  <cell>
    <xsl:value-of select="description" />
  </cell>
</row>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

Output:
<table>
<tr>
<td><cell><link href="/forum/Nyheder"></cell></td>
<td><cell>Diskussion af nyheder</cell></td>
</tr>
<tr>
<td><cell><link href="/forum/Artikler"></cell></td>
<td><cell>Forum for artikler på siden.</cell></td>
</tr>
<tr>
<td><cell><link href="/forum/Alt"></cell></td>
<td><cell>Alt</cell></td>
</tr>
</table>