transforming somewhat relational XML
Posted: Wed Nov 19, 2008 2:30 am
I've got some XML that links nodes with an ID of sorts but I need to put them together... The XML is somewhat propriatary so I can't post an actual sample (or someone will come and kill me in the night ... lol) but here is an idea of what I'm dealing with:
So, what I need to do is relate the index/group/proposal/ref to the recommendation/itemNumber/number so I could output:
05/12/08 $14.50
05/12/08 $12.50
07/12/08 $16.50
07/12/08 $18.50
I can't come up with a way to do that? any ideas?
Code: Select all
<searchReply>
<index>
<group>
<proposal><ref>1</ref></proposal>
<date>051208</date>
</group>
<group>
<proposal><ref>2</ref></proposal>
<date>071208</date>
</group>
</index>
<proposals>
<recommendation>
<itemNumber><number>1</number></itemNumber>
<priceDetail><amount>14.50</amount></priceDetail>
</recommendation>
<recommendation>
<itemNumber><number>1</number></itemNumber>
<priceDetail><amount>12.50</amount></priceDetail>
</recommendation>
<recommendation>
<itemNumber><number>2</number></itemNumber>
<priceDetail><amount>16.50</amount></priceDetail>
</recommendation>
<recommendation>
<itemNumber><number>2</number></itemNumber>
<priceDetail><amount>18.50</amount></priceDetail>
</recommendation>
</proposals>
</searchReply>
05/12/08 $14.50
05/12/08 $12.50
07/12/08 $16.50
07/12/08 $18.50
I can't come up with a way to do that? any ideas?