G
Gadrin77
is it possible to get a unique ID or key for a union of the following XML
<Bonus>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category Two" Value="2"/>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category Two" Value="2"/>
<BonusItem Name="Category Six" Value="6"/>
<OtherItem Name="Category One" Value="1"/>
<OtherItem Name="Category Two" Value="2"/>
<OtherItem Name="Category Six" Value="6"/>
</Bonus>
I want to get a summary that looks like:
Category One: 4
Category Two: 6
Category Six: 12
I can select both using select="/Bonus/BonusItem | /Bonus/OtherItem"
<xsl:key match="BonusItem|OtherItem" use="@Name">
but the match= attribute in the <xsl:key> didn't seem to care about the
union operator inside it and still listed the OtherItem @Names separately.
Is it possible to combine them into a single, unique list, or do I have to
create a new set of XML from the above and then make a unique list from
that?
I'm using MS XML 4 SP2
<Bonus>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category Two" Value="2"/>
<BonusItem Name="Category One" Value="1"/>
<BonusItem Name="Category Two" Value="2"/>
<BonusItem Name="Category Six" Value="6"/>
<OtherItem Name="Category One" Value="1"/>
<OtherItem Name="Category Two" Value="2"/>
<OtherItem Name="Category Six" Value="6"/>
</Bonus>
I want to get a summary that looks like:
Category One: 4
Category Two: 6
Category Six: 12
I can select both using select="/Bonus/BonusItem | /Bonus/OtherItem"
<xsl:key match="BonusItem|OtherItem" use="@Name">
but the match= attribute in the <xsl:key> didn't seem to care about the
union operator inside it and still listed the OtherItem @Names separately.
Is it possible to combine them into a single, unique list, or do I have to
create a new set of XML from the above and then make a unique list from
that?
I'm using MS XML 4 SP2