|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Merging Data
Hi Everyone I need to combine two sets of data (File A and File B). The structure is as follows (snippet): FILE A: <supplements> <supp> <supp-desc>Half Board</supp-desc> <supp-price>#10</supp-price> </supp> <supp> <supp-desc>All Inclusive</supp-desc> <supp-price>#20</supp-price> </supp> <supp> <supp-desc>Sea View</supp-desc> <supp-price>#3</supp-price> </supp> ... </supplements> FILE B: <supplements> <supp> <supp-desc>Half Board</supp-desc> <supp-price>#20</supp-price> </supp> <supp> <supp-desc>All Inclusive</supp-desc> <supp-price>#40</supp-price> </supp> <supp> <supp-desc>Balcony</supp-desc> <supp-price>#5</supp-price> </supp> ... </supplements> REQUIRED OUTPUT: <supplements> <supp> <supp-desc>Half Board</supp-desc> <supp-price source="filea">#10</supp-price> <supp-price source="fileb">#20</supp-price> </supp> <supp> <supp-desc>All Inclusive</supp-desc> <supp-price source="filea">#20</supp-price> <supp-price source="fileb">#40</supp-price> </supp> <supp> <supp-desc>Sea View</supp-desc> <supp-price source="filea">#3</supp-price> <supp-price source="fileb">-</supp-price></supp> <supp> <supp-desc>Balcony</supp-desc> <supp-price source="filea">-</supp-price> <supp-price source="fileb">#5</supp-price></supp> ... </supplements> DESCRIPTION: I need to compare <supp> nodes based on the text value of <supp-desc>. If the <supp> exists in both files then the <supp-price> node from File B is added underneath the <supp-price> node from File A (a "source" attribute is also added). If the <supp> exists in one file but not the other, a <supp-price> node with the text value of "-" is added. "Sea View" and "Balcony" are examples of <supp> being present in one file only. Any suggestions on how best to achieve the desired result will be greatly appreciated. -- Kevin Bird
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








