Subject: [xsl] union and difference From: "Steve Renshaw" <renshaw_steve@xxxxxxxxxxx> Date: Sun, 13 May 2001 04:39:21 -0000 |
<xsl:template match="Sets"> <xsl:variable name="set1" select="set1"/> <xsl:variable name="set2" select="set2"/> Intersection #1={ <xsl:for-each select="$set1[count(.|$set2)=count($set2)]"> <xsl:value-of select="."/><br/> </xsl:for-each>} Intersection #2={ <xsl:for-each select="$set1[. = $set2]"> <xsl:value-of select="."/>. </xsl:for-each>} <xsl:variable name="set2" select="set2"/> In $set1 but not $set2 #1={ <xsl:for-each select="$set1[count(.|$set2)!=count($set2)]"> <xsl:value-of select="."/>, </xsl:for-each>} In $set1 but not $set2 #2={ <xsl:for-each select="$set1[not(. = $set2)]"> <xsl:value-of select="."/>, </xsl:for-each>} </xsl:template>
<Sets> <set1>A</set1><set1>B</set1><set1>C</set1><set1>D</set1> <set2>C</set2><set2>D</set2><set2>E</set2><set2>F</set2> </Sets> _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] what am I missing?, Chris Bayes | Thread | Re: [xsl] union and difference, Trevor Nash |
RE: [xsl] JAXP Transformer contract, Michael Kay | Date | [xsl] problem with name="type" in h, Jo Bourne |
Month |