transform problem

Sparko

Usenet Archive
Joined
Feb 24, 2003
Messages
8
Reaction score
0
OK here's one that's puzzlin me!

xml source

<x yid="1" > <x yid="2" > <x yid="n" >

<z yid="1" zid="1" ca1="" ca2="aValue1" ca3=""/>
<z yid="1" zid="2" ca1="aString1" ca2="" ca3=""/>
<z yid="1" zid="3" ca1="" ca2="" ca3="aValue2"/>
<z yid="1" zid="4" ca1="" ca2="aString2" ca3=""/>
<z yid="1" zid="5" ca1="" ca2="" ca3="aString3"/>
<z yid="2" zid="1" ca1="" ca2="aValue3" ca3=""/>
<z yid="2" zid="2" ca1="aString4" ca2="" ca3=""/>
<z yid="2" zid="3" ca1="" ca2="" ca3="aValue4"/>
<z yid="2" zid="4" ca1="" ca2="aString5" ca3=""/>
<z yid="2" zid="5" ca1="" ca2="" ca3="aString6"/>

xml output required
<x yid="1" ca1="aValue1" ca2="aString1" ca3="aValue2" ca4="aString2" ca5="aString3"/> <x yid="2" ca1="aValue1" ca2="aString4" ca3="aValue3" ca2="aString5" ca2="aString6"/> ...n

Description
The input xml must be resolved such that attributes are added to the x nodes corresponding to the z nodes row with the relationship being yid and the set of z nodes always containing five nodes identified by zid. For each of the five z nodes that is processed (per yid) a set algorithm is applied that extracts the value from the correct ca attribute and uses it as the value of the attribute that is being inserted into the x node.

Any thoughts!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top