XML:
<Budget>
<Table1>
<AllocID>1</AllocID>
<Amount>1000</Amount>
</Table1>
<Table1>
<AllocID>2</AllocID>
<Amount>2000</Amount>
</Table1>
<Table1>
<AllocID>3</AllocID>
<Amount>3000</Amount>
</Table1>
<Table2>
<AllocID>1</AllocID>
<Split>100</Split>
</Table2>
<Table2>
<AllocID>2</AllocID>
<Split>100</Split>
</Table2>
</Budget>
I am displaying the amounts in a table, but only if a "Split" value exists in Table2.
<xsl:for-each select="Budget/Table1">
<xsl:for-each select="//Budget/Table2[AllocID = current()/AllocID]">
<xsl:value-of select="Amount"/>
</xsl:for-each>
</xsl:for-each>
//Total for the records here.
I need to get the sum of Amounts from Table1, but only if a value for the AllocID exists in Table2. So in this example, I only want the sum of Amount for AllocIDs 1 & 2. How would I do this in xslt without modifying the given datasets?