Subject: [xsl] apply-templates select and current() question From: "Bruce D'Arcus" <bdarcus@xxxxxxxxx> Date: Wed, 18 May 2005 22:42:38 -0400 |
I'm trying to implement citation processing where citations basically treated as if they were footnotes; rendered and numbered the same.
So I created a union template in its own mode like so, which is close to working correctly.
<xsl:template match="db:footnote | db:citation" mode="footcite"> <xsl:variable name="incr"> <xsl:number level="any" count="db:footnote | db:citation[not(../db:footnote)]"/> </xsl:variable> <p id="fn{$incr}"> <a href="#fnm{$incr}" class="footnote-anchor"> <xsl:value-of select="$incr"/> </a> <xsl:text>.  </xsl:text> <xsl:apply-templates select="if (current() = db:footnote) then * else ."/> </p> </xsl:template>
- if current() is db:citation apply-templates to itself in the default mode - if current() is db:footnote, then just do the standard apply-templates to the children
.. which tells me that even though the current() for the this element is in fact db:footnote, the select is "."
If I change the select statement to just "*", then that part gets rendered correctly.
If I change the statement to "if (../db:footnote) then * else ." then it also seems to work (there's one problem that I think is unrelated).
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl variable not resolved, Aron Bock | Thread | Re: [xsl] apply-templates select an, Wendell Piez |
RE: [xsl] nested for-each to create, Aron Bock | Date | Re: [xsl] XPath query syntax, Jay Bryant |
Month |