Subject: Re: [xsl] recursive counter not incrementing From: Christopher Hansen <chansen1@xxxxxxxxx> Date: Thu, 9 Dec 2004 12:56:59 -0500 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] recursive counter not inc, David Carlisle | Thread | Re: [xsl] recursive counter not inc, António Mota |
RE: [xsl] for-each does not iterate, Robert Soesemann | Date | RE: [xsl] for-each does not iterate, Michael Kay |
Month |