Subject: navigation, TEI From: "kirunews" <kirunews@xxxxxxxxxxx> Date: Wed, 23 Jun 2004 06:43:08 +0200 |
Dear List! 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> <xsl:choose> <xsl:when test="(preceding-sibling::*[$nodeSet]/head)[last()]"> <xsl:copy-of select="preceding::*[$nodeSet]/head[last()]" /> </xsl:when> <xsl:when test="(ancestor::*[$nodeSet]/head)[last()]"> <xsl:copy-of select="ancestor::*[$nodeSet]/head[last()]" /> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:template> and i call this with: <xsl:variable name="previous"> <xsl:call-template name="getPrev" /> </xsl:variable> but as i would like to get the id of the node the following code doesn't work: <xsl:variable name="previousID"> <xsl:value-of select="generate-id( $previous )" /> </xsl:variable> with the xsl processor saying: 'generate-id() : invalid arg expecting a node-set' So i have to write another template (getPrevID) with the only difference of the selection: 'select="generate-id( ... )"' and the xpath expression (preceding-sibling::*[$nodeSet]/head)[last()] is the same than this: (preceding-sibling::*/head)[last()] the $nodeSet variable doesn't work at this situation. I use the 'xsltproc.exe' program shipped with TEI-Emacs. Have you got any idea to solve these problems? Thanks, kiraly peter http://www.arcanum.hu
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Working with xs:date and , Colin Paul Adams | Thread | RE: [xsl] navigation, TEI, Jarno.Elovirta |
Re: [xsl] Working with xs:date and , Colin Paul Adams | Date | Re: [xsl] Working with xs:date and , Colin Paul Adams |
Month |