[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

same xpath, different results?

Subject: same xpath, different results?
From: "Corey Wilson" <corey@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Jun 2003 10:05:52 -0400
corey wilson
    <xsl:variable name="totalComm">
     <xsl:variable name="whichRate">
      <xsl:choose>
       <xsl:when test="js:overYear(string(../../dateEntered)) = 'false'">
        <!-- xsl:value-of
select="./commissions/commission[earnerId=$earnerId]/product[productId=../..
/../products/product/id]/rate" / -->
        <xsl:value-of
select="./products/product[id=../../commissions/commission[earnerId=$earnerI
d]/product/productId]/count" />
       </xsl:when>
       <xsl:otherwise>
        <xsl:value-of
select="./products/product[id=../../commissions/commission[earnerId=$earnerI
d]/product/productId]/count" />
       </xsl:otherwise>
      </xsl:choose>
     </xsl:variable>
     <xsl:call-template name="commTotal">
      <xsl:with-param name="cnt"
select="./products/product[id=../../commissions/commission[earnerId=$earnerI
d]/product/productId]/count" />
      <xsl:with-param name="baseCst" select="$whichRate" />
     </xsl:call-template>
    </xsl:variable>

In the above code, I am trying to pick a different rate based on a
"dateEntred" node.  I am not sure why, but the variable $whichRate will
always have only 1 element but the paramater cnt will have a variable number
of elements... The variable number of elements is what I am going for, but
it doesn't seem to work in the first test.  The reason I put the same xpath
in all of them was just for testing purposes.  The reason I am doing this is
trying to get either a "rate" or "secondaryRate" depending on the
"dateEntered".

Thanks for any help!


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.