Hi Joe,
What I don't get is that you try to check the position of the h2
element by testing the text value of the element.
I would guess something like:
<xsl:if test="preceding::h2">
...
</xsl:if>
You could prehaps split them up into two different templates:
One:
<xsl:template match="h2[not(preceding::h2]" name="h2_general">
<!-- Do the code that does not have a back-to-top link -->
...
</xsl:template>
<xsl:template match="h2">
<!-- This will match all that are not first in the hierarchy -->
<!-- Do the code that creates a back-to-top link -->
<xsl:call-template name="h2_general"/>
</xsl:template>
Untested!
Regards,
Ragulf Pickaxe :-)
On 6/21/05, Joe Stump <joe(_at_)joestump(_dot_)net> wrote:
Doing:
<xsl:if test="normalize-space(//h2[1]/text()) != normalize-space(text
())">
Fixed it. Quite annoying ...
--Joe
On Jun 21, 2005, at 10:56 AM, Joe Stump wrote:
I've got a bunch of h2's in a document that I want to group at the
top with jumps to the actual h2's in the body, which I have working
without incident. The problem I have is with links back to the top.
Basically, if it's NOT the first h2, it should show a "Back to Top"
link above the h2. I have a test that appears to be exactly what I
need, but it's not working. The basic test is:
<Snip/>
--Joe
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--