to the main page about the tutorial  THE XML REVOLUTION  -  TECHNOLOGIES FOR THE FUTURE WEB back up next

Computed result fragments

Result fragments can be computed using XPath expressions: The attributes may contain {expression}: XPath expressions which are evaluated (and coerced to string) on instantiation.

Example:
<xsl:template match="section">
  <xsl:element name="sec{@level}">
    <xsl:attribute name="kind">
      <xsl:value-of select="kind"/>
    </xsl:attribute>
  </xsl:element>
</xsl:template>

This template rule converts
 <section level="3"><kind>intro</kind></section>
into
 <sec3 kind="intro"/>.

back COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next