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.
Code:<select name="QueryRef" size="1"> <option value="">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>


Reply With Quote
Bookmarks