Stylesheet template example II

  • Adding a target and a link symbol to selected a elements:
    <xsl:template match="//a[@class='selected']">
      <xsl:copy>
        <xsl:attribute name="target">windowname</xsl:attribute>
        <xsl:for-each select="@*">
          <xsl:copy/>
        </xsl:for-each>
        <xsl:apply-templates/>
      </xsl:copy>
      <img src="outlink.png" alt="outlink"/>
    </xsl:template>
 
© Copyright 2004 Michael Kröll