www.webdeveloper.com
Results 1 to 2 of 2

Thread: xPath...following-sibling?

  1. #1
    Join Date
    Feb 2003
    Posts
    4

    xPath...following-sibling?

    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>

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    It has been long while since I used XSLT.
    But the ultimate place for help is this.

    http://lists.mulberrytech.com/

    Cheers

    Khalid

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles