xPath...following-sibling?

wxdqz

New Member
Hi,

Am not very familiar with using xPath and I would like use the 'following-sibling' axis to get the next column of info I'm reading in from my Database. I'm assuming that I can use it from within my XSL doc I just can't seem to figure out the correct coding.

The basic structure of retireving the data (into a dropdown menu) from within my XSL is: (Apologies for indentation)

Any assistance would be much appreciated.




<select name="QueryRef" size="1">
<option value=http://www.webdeveloper.com/forum/archive/index.php/"">Choose Query Description</option>
<xsl:variable name="selectedQueryRef">
<xsl:value-of select="/page/@QueryRef" />
</xsl:variable>

<xsl:for-each select="/page/QueryCode/row">
<xsl:variable name="current">
<xsl:value-of select="./col" />
</xsl:variable>

<xsl:choose>
<xsl:when test="$selectedQueryRef=$current">
<xsl:element name="option">
<xsl:attribute name="selected">
selected
</xsl:attribute>

<xsl:attribute name="value">
<xsl:value-of select="./col" />
</xsl:attribute>

<xsl:value-of select="./col" />

</xsl:element>
</xsl:when>

<!--this next loop gets values of the first element of the row, I need to retrieve the next element? -->

<xsl:otherwise>
<xsl:element name="option">
<xsl:attribute name="value">
<xsl:value-of select="./col" />
</xsl:attribute>

<!--retirieves values of the first column and places in the dropdown list-->

<xsl:value-of select="./col" />

</xsl:element>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>
</select>
 
Back
Top