R
RamiReddy.com
Guest
Below is the my original XML file and requirement details.
<?xml version="1.0" encoding="utf-8"?>
<Payments>
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="40" P8="20" />
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="10" />
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="30" />
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="50" P8="50"/>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
</Payments>
I am looking for:
I am attaching the expected result as:
<?xml version="1.0" encoding="utf-8"?>
<Payments>
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="40" P8="20" >
<R P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="10" />
<R P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="30" />
</P>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="50" P8="50">
<R P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
<R P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
</P>
</Payments>
Could you please look into this. Let me know if you need any further details.
Thank you in advance.
Continue reading...
<?xml version="1.0" encoding="utf-8"?>
<Payments>
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="40" P8="20" />
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="10" />
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="30" />
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="50" P8="50"/>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
</Payments>
I am looking for:
- Based on ID and Amount attribute value, we need to create child attributes.
- Example: For ID = "A", we have three records and only for one record we have amount = "40", Here we need to create another TAG for child records.
I am attaching the expected result as:
<?xml version="1.0" encoding="utf-8"?>
<Payments>
<P P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="40" P8="20" >
<R P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="10" />
<R P1="492" P2="BTX" P3="492V" P4="1" P5="A" ID="A" Amount="0" P8="30" />
</P>
<P P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="50" P8="50">
<R P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
<R P1="492" P2="BTX" P3="492V" P4="2" P5="B" ID="B" Amount="0" P8="50"/>
</P>
</Payments>
Could you please look into this. Let me know if you need any further details.
Thank you in advance.
Continue reading...