|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: use-when attribute?
On Dec 18, 2004, at 5:30 AM, Geert Josten wrote:
you could use the following: I was originally using keys (at your suggestion, in fact), but Mike Kay at one point seemed to suggest it better for my purposes to use a variable. I didn't quite understand why, but here's his explanation: ==== I don't really see what a key with a constant "use" expression achieves. Apart from the fact that it applies to whichever document is current at the time, you could just as well (and probably better) use a global variable <xsl:variable name="citekey" select="//db:biblioref/@linkend"/> ==== The code subsequently gets used in these two variables: <!--+ ============================================================== | create a table against which to measure relative citation position +--> <xsl:variable name="cite-position"> <bib:refs> <bib:all> <xsl:for-each select="$citerefs"> <bib:ref position="{position()}" id="{generate-id()}" key="{.}"/> </xsl:for-each> </bib:all> <bib:unique> <xsl:for-each-group select="$citerefs" group-by="."> <bib:ref position="{position()}" id="{generate-id()}" key="{.}"/> </xsl:for-each-group> </bib:unique> </bib:refs> </xsl:variable> <!--+ ============================================================== | construct a list of unique references to pass to a query +--> <xsl:variable name="citekeys"> <xsl:text>(</xsl:text> <xsl:for-each-group select="$citerefs" group-by="."> <xsl:if test="position() > 1">,%20</xsl:if> <xsl:text>'</xsl:text> <xsl:value-of select="."/> <xsl:text>'</xsl:text> </xsl:for-each-group> <xsl:text>)</xsl:text> </xsl:variable> 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








