|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: modes and temp trees (was Re: grouping + glo
On Aug 17, 2004, at 10:26 AM, Jeni Tennison wrote:
Since the current element is a <mods:mods> element, the test is guaranteed to be true. For whatever reason, this doesn't work for me. I originally had that statement, but couldn't get it to work. That's why I ended up with the one I posted. Here's the template again (the key is declared at the top of the stylesheet, and also used in the bibliography mode): <xsl:template match="db:biblioref"> <xsl:variable name="idref" select="@linkend"/> <xsl:variable name="bibref" select="key('bibref', $idref)" /> <xsl:for-each-group select="$bibref" group-by="bib:grouping-key(.)"> <xsl:sort select="current-grouping-key()"/> <xsl:for-each-group select="current-group()" group-by="xs:integer(mods:year)"> <xsl:sort select="current-grouping-key()"/> <xsl:for-each select="current-group()"> <a href="#{@ID}" xmlns="http://www.w3.org/1999/xhtml"> <!-- PROBLEM: need to collapse like (Doe, 1999a, c), but this won't work. --> <xsl:if test="position() = 1"> <xsl:apply-templates select="mods:name" mode="citation"/> <xsl:text>, </xsl:text> <xsl:value-of select="mods:year"/> </xsl:if> <xsl:apply-templates select="mods:key"/> <xsl:if test="position() != last()">, </xsl:if> </a> </xsl:for-each> </xsl:for-each-group> </xsl:for-each-group> <xsl:if test="position() != last()">; </xsl:if> </xsl:template> Declare it like: I was wondering about using keys. Do you think it'd be better to do this the other way around, though, and have a key for all the biblioref/@linkend values (the actual docbook citations), and when I process the mods:mods records, call those? Wouldn't that ensure that only those records that contain a biblioref element with their ID linkend actually get processed? Of course, I may have multiple linkends for the same record ID. A related question: is there anywhere else obvious I ought to be drawing on keys? For example, this business of creating conditional formatting using grouping (the Doe, 1999a, b stuff) is quite processing intensive (at least as I have it in my stylesheet). For both the bibliography and the citations, I have to group and sort (often multiple times), and then figure out how to format based on position in the group. Is there some smarter, less processing-intensive, way to do this using keys? 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








