Subject: Re: [xsl] Sum of identical nodes From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Wed, 20 Jul 2005 10:34:46 +0200 |
Each file in File1 and File2 have few hundreds nodes of <moid></moid> and <mt></mt>. My biggest hindrance is how to recursively sum up each node from each nodeset.
<xsl:param name="file1" select="/"/> <xsl:param name="file2" select="document('file2.xml')"/>
<xsl:template match="/"> <xml> <xsl:apply-templates select="$file1/xml/*" mode="merge"/> </xml> </xsl:template>
<xsl:template match="mt" mode="merge"> <xsl:variable name="pos" select="position()"/> <xsl:copy> <xsl:value-of select="sum(. | $file2/xml/*[$pos])"/> </xsl:copy> </xsl:template>
<xsl:template match="moid" mode="merge"> <xsl:copy-of select="."/> </xsl:template>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) "N N1N;N.N8N5N9N1 N:N1N9 ON? N;N,N4N9 ON,N=ON1 N2N3N1N/N=N?ON= N1OO ON,N=O "
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Sum of identical nodes, Alvin Ng | Thread | Re: [xsl] Sum of identical nodes, Joris Gillis |
[xsl] Semantics of deep-equal funct, Mukul Gandhi | Date | Re: [xsl] Semantics of deep-equal f, David Carlisle |
Month |