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

Re: recursive counter not incrementing

Subject: Re: recursive counter not incrementing
From: Christopher Hansen <chansen1@xxxxxxxxx>
Date: Thu, 9 Dec 2004 12:56:59 -0500
incrementing variable value in xsl
David, 
Thanks for suggesting the count/union operation...i researched it a
little bit and it makes complete sense, however i must be doing
something wrong because its not returning TRUE when it should be...see
the IF statement in the subset template below.  I've reminded you how
i initialized $s1 and $s2 in the main template....


 <!--using the 2nd transaction...-->
 <xsl:variable name="transitems1"
select="document('transactions.xml')//transaction[2]" />
 
<xsl:output method="html"/>
  <xsl:template match="/">

      <!-- set1 = 1st itemset consisting of 3 items Milk, Butter, Eggs
(using itemsets.xml)-->
      <xsl:variable name="set1" select= "frequent_item_sets//set[1]" />
      <!-- set2 = 2nd transaction, 11 items (Milk, Butter, and Eggs
among them) -->
      <xsl:variable name="set2" select="$transitems1/items" />

          <!--output both sets-->
          <xsl:value-of select="$set1"/>
          <xsl:value-of select="$set2"/>
      
      <xsl:call-template name="subset">
           <xsl:with-param name="s1" select="$set1"/>
           <xsl:with-param name="s2" select="$set2"/>
      </xsl:call-template>

<xsl:template name="subset">
     <xsl:param name="s1"/>
     <xsl:param name="s2"/>
  
    <xsl:value-of select="count($s1/item)"/> <!--shows '3' -->
    <xsl:value-of select="count($s2/item)"/> <!--shows '11'-->
 
    <!--following is not executing-->
    <xsl:if test="count($s1/item|$s2/item)=count($s1/item)">
        <b>S1 is a subset of S2.</b>
    </xsl:if>

</xsl:template>


On Thu, 9 Dec 2004 11:50:52 GMT, David Carlisle <davidc@xxxxxxxxx> wrote:
> 
> > I read the problem as being based on equality rather than identity of nodes,
> > but I might not have read carefully enough...
> 
> I read it that way, but was trying to be Jeni and answered what I
> suspected was the real question. We'll see if I really am Jeni
> or not...
> 
> 
> 
> David
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________

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.