|
Subject: [xsl] [XSL] id() in Ancestor Nodes? From: Alice Ju-Hsuan Wei <ajwei@xxxxxxxxxxx> Date: Wed, 3 Oct 2007 23:28:33 -0400 |
</publisherList>
</profileDesc>
</bookshelfHeader>
<text>
<body>
<bookGroup>
<collection type="xslt">
<book publish="wrox" date="2002">
<title>
<emph>Beginning XSLT</emph>
</title>
<title>
<emph>Essential XML Quick
Reference</emph></title>
</book>
<book publish="oreilly" date="2003">
<title>
<emph>.NET and XML</emph>
</title>
</book>
</collection>
</bookGroup>
</body>
</text>
</bookshelf> <xsl:template match="book">
<div>
<xsl:call-template name="bookpublisher" />
<span><xsl:apply-templates/>
</span>
</div>
</xsl:template><xsl:template name="bookpublisher">
<span class="bookpublisher">
Books Published by
<xsl:choose>
<xsl:when test="./@publish ='wrox'">Wrox</xsl:when>
<xsl:when test="./@publish ='oreilly'">Oreilly</xsl:when>
</xsl:choose>,
<xsl:attribute name="class">
<xsl:value-of select="./@date" />
</xsl:attribute>.
</span>
</xsl:template><xsl:template match="title"> <i><xsl:apply-templates/></i> </xsl:template>
<xsl:template match="emph"> <b><xsl:apply-templates/></b> </xsl:template>
<xsl:template name="bookpublisher">
<xsl:variable name="name" select="id('@publish')"/>
<span class="character">
<xsl:value-of select="$name"/>
</span>
</xsl:template>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] IE error | Switch from cu, Nick Fitzsimons | Thread | Re: [xsl] [XSL] id() in Ancestor No, G. Ken Holman |
| RE: [xsl] Question about HTML tags, Joe Fawcett | Date | [xsl] Ann: InPlace, a new xslt-base, Oleg A. Paraschenko |
| Month |