Results 1 to 2 of 2

Thread: [RESOLVED] xsl query problem

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Resolved [RESOLVED] xsl query problem

    Below is a short sample of the xml that I'm working with. What I would like is to use a for-each loop to pull the <totalavailable> by region.

    I thought something like this would work but it isn't. Anyone see what I'm missing?

    Code:
    <xsl:for-each select="coop/coop_list/coop[region='02']/totalavailable">
    	<td><xsl:value-of select="totalavailable"/></td>
    </xsl:for-each>
    Code:
    <coop>
    	<coop_list>
    		<coop>
    			<region>01</region>
    			<budgetfy>2002</budgetfy>
    			<totalavailable>2.9</totalavailable>
    		</coop>
    		<coop>
    			<region>01</region>
    			<budgetfy>2003</budgetfy>
    			<totalavailable>0</totalavailable>
    		</coop>
    		<coop>
    			<region>02</region>
    			<budgetfy>2001</budgetfy>
    			<totalavailable>31.03</totalavailable>
    		</coop>
    		<coop>
    			<region>02</region>
    			<budgetfy>2002</budgetfy>
    			<totalavailable>2.16</totalavailable>
    		</coop>
    		<coop>
    			<region>02</region>
    			<budgetfy>2003</budgetfy>
    			<totalavailable>108.1</totalavailable>
    		</coop>
    	</coop_list>
    </coop>

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: xsl query problem

    I knew I was close. This is what worked for me
    Code:
    <xsl:for-each select="//coop[region='02']/totalavailable">
    	<td><xsl:value-of select="."/></td>
    </xsl:for-each>

Posting Permissions

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



Click Here to Expand Forum to Full Width