transform problem

S

Sparko

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
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top