|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] apply-templates select and current() question
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>The above select statement is supposed to: - 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 However, for the latter I end up with this: 2. [1] .. 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). So what's going on?? Bruce
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








