[xsl] [newbie] What is the problem with preceding::simplesect/@id ?

Subject: [xsl] [newbie] What is the problem with preceding::simplesect/@id ?
From: Thomas Dupouy <moz@xxxxxx>
Date: Mon, 25 Feb 2002 09:27:09 +0100
Hello,
I'm new to xslt, and there are some problems I cannot understand. This
one : two navigation links following "simple sections" of an XML
docbook.
<!-- ----------------------- start ---------------------- -->
<tr><td align="left" nowrap="0">
Previous:&#160;
 <a>
  <xsl:attribute name="href">
   <xsl:text>romans.php?book=</xsl:text>
   <xsl:value-of select="$filename"/>
   <xsl:text>&amp;section=</xsl:text>
   <xsl:value-of select="preceding::simplesect/@id"/>
  </xsl:attribute>
  <xsl:value-of select="preceding::simplesect/title"/>
 </a>	
</td><td align="right" nowrap="0">
Next:&#160;
 <a>
  <xsl:attribute name="href">
   <xsl:text>romans.php?book=</xsl:text>
   <xsl:value-of select="$filename"/>
   <xsl:text>&amp;section=</xsl:text>
   <xsl:value-of select="following::simplesect/@id"/>
  </xsl:attribute>
  <xsl:value-of select="following::simplesect/title"/>
 </a>
<!-- ----------------------- end ---------------------- -->
The problem is that if the "Next" link go well to the following
simplesect, and through chapters, the "Previous" link always give the
first simplesect of the current chapter, instead of just the preceding
simplesect. I'm using PHP4+Sablotron if it makes a difference.

Thanks in advance for your solutions.

Regards,

--  
Thomas Dupouy
moz@xxxxxx

"J'ai lu dernièrement une préface (la préface de Mademoiselle La
Quintinie) où elle prétend qu'un vrai chrétien ne peut pas croire à
l'Enfer. Elle a de bonnes raisons pour vouloir supprimer l'Enfer."

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread