Subject: RE: [xsl] navigation, TEI From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 23 Jun 2004 11:18:06 -0400 |
Cheers, Wendell
...> I'm working on extending the TEI xsl stylesheet set with a more > complex 'prev-next' navigation bar. For the linking i need two > parameters: the text of the link, and the id of the link. > I use a template to get the appropriate node: > > <xsl:template name="getPrev"> > <xsl:variable name="nodeSet"> > <xsl:text>self::div0 | self::div1 | self::div2 | > self::div3 | self::div4</xsl:text> > </xsl:variable>
Here you're binding $nodeSet to a Result Tree Fragment and?
> <xssl:choose> > <xsl:when test="(preceding-sibling::*[$nodeSet]/head)[last()]">
? here if will always returnn true...
How about
<xsl:template name="getPrevID">
<xsl:choose>
<!--here you don't need to test for the last, because it will be true even if you have just one div# head -->
<xsl:when test="preceding-sibling::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head">
<xsl:value-of select="generate-id(preceding::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head[last()])" />
</xsl:when>
<xsl:when test="ancestor::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head">
<xsl:value-of select="generate-id(ancestor::*[self::div0 | self::div1 | self::div2 | self::div3 | self::div4]/head[last()])" />
</xsl:when>
</xsl:choose>
</xsl:template>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] navigation, TEI, Jarno.Elovirta | Thread | Re: [xsl] navigation, TEI, kirunews |
Re: [xsl] Get NaN when adding, Markus Abt | Date | Re: [xsl] alternate backgrounds pro, Wendell Piez |
Month |