In the xml document below, I would like to retrieve the distinct
attributes for the element '<Bal>'. However, I haven't had any
success. Here is what I have so far:
<TRANS>
<TRAN TRAN_DESC_CD="ACRT" TRAN_DESC="Actual Rate">
<BAL BAL_FLD_NUM="3" BAL_FLD_DSCR="Actual Rate Amount">
<SUBDEAL SUB_Deal_ID="0011-01" />
</BAL>
<BAL BAL_FLD_NUM="3" BAL_FLD_DSCR="Actual Rate Amount">
<SUBDEAL SUB_Deal_ID="0013-01" />
</BAL>
<BAL BAL_FLD_NUM="2" BAL_FLD_DSCR="Actual Rate Amount">
<SUBDEAL SUB_Deal_ID="00112-01" />
</BAL>
<BAL BAL_FLD_NUM="6" BAL_FLD_DSCR="Actual Dispersion Amount">
<SUBDEAL SUB_Deal_ID="02342-01" />
</BAL>
</TRAN>
</TRANS>
IEnumerable<XAttributeICOA =
(from ddList in GxmlCOA.Descendants("BAL").Attributes()
select ddList).Distinct();
So the distinct bal fields should be:
1) Text = "Actual Rate Amount"
Val = 3
2) Text = "Actual Rate Amount"
Val = 2
3) Text = "Actual Dispersion Amount"
Val = 6
Unfortunately, the LINQ query isn't working.