NOTE:
These slides have not been updated since 2003. They have been superseded by the book
Anders Møller and Michael Schwartzbach, February 2006 |
THE XML REVOLUTION - TECHNOLOGIES FOR THE FUTURE WEB |
A key is a triple (node, name, value) associating a name-value pair to a tree node.
Example:
<xsl:key name="mykeys" match="section[@id]" use="@id"/> <xsl:template match="section"> <h1> <a name="{generate-id()}"> <xsl:number/> <xsl:apply-templates select="title"/> </a> </h1> <xsl:apply-templates select="body"/> </xsl:template> <xsl:template match="ref[@section]"> <a href="#{generate-id(key('mykeys',@section))}"> <xsl:for-each select="key('mykeys',@section)"> Section <xsl:number/> </xsl:for-each> </a> </xsl:template> |
Comparison to DTD IDs:
COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |