Posted: Tue Oct 07, 2003 4:59 am Post subject: XML transformation using CREATE/NEXTSIBLING
Novice
Joined: 24 Jul 2003 Posts: 19
Hi,
The following input xml is to be transformed to below output xml.
1.Parent to Child transformation as seen on output for the underscore elements and it should be created under the same tag
Code:
<aaa>
<* please do not use *>23</* please do not use *>
<vvv>25</vvv>
</aaa>
2.Moving the Root
Code:
<abc>
<xxx>21</xxx>
<yyy>22</yyy>
</abc>
into <cde> </cde> as last child
I/P Part of the XML which needs to be transformed
Code:
<abc>
<xxx>21</xxx>
<yyy>22</yyy>
<cde>
<mmm>
<efg>
<* please do not use *>23</* please do not use *>
<aaa_vvv>25</aaa_vvv>
<bbb_yyy>26</bbb_yyy>
<ccc>27</ccc>
</efg>
<ghi>
<ddd>28</ddd>
<eee_zzz>29</eee_zzz>
<eee_www>30</eee_www>
<fff_ppp>31</fff_ppp>
</ghi>
</mmm>
</cde>
</abc>
O/P Part of the XML which needs to be transformed
<cde>
<mmm>
<efg>
<aaa>
<* please do not use *>23</* please do not use *>
<vvv>25</vvv>
</aaa>
<bbb>
<yyy>26</yyy>
</bbb>
<ccc>25</ccc>
</efg>
<ghi>
<ddd>23</ddd>
<eee
<zzz>29</zzz>
<www>30</www>
</eee>
<fff
<ppp>31</ppp>
</fff>
</ghi>
<abc>
<xxx>21</xxx>
<yyy>22</yyy>
<abc>
</mmm>
</cde>
I would appreciate your hints and template looping code which will store the value.I have seen examples of moving within same siblings and I assume that I wil be needing 2 while loops to accomplish this..
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum