transforming somewhat relational XML
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed Nov 19, 2008 2:13 am
transforming somewhat relational XML
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?
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: transforming somewhat relational XML
Look at xsl:key. That allows you to identify a set of notes for a specific value. It is basically a hashtable that for a given value gives you the set of nodes that match that value.
Hope that helps,
George
Hope that helps,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service