XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Posttop
Anirudh VyasSubject: Flat XML to nested XML conversion
Author: Anirudh Vyas
Date: 08 Oct 2008 07:43 AM
Originally Posted: 08 Oct 2008 07:38 AM
Hi,

I am working on transforming flat-XML to nested XML structure.

My src structure is:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ROOT>
<TRAN>
<B01>
<A>q</A>
</B01>
<B02>
<B>A</B>
</B02>
<B03>
<C>W</C>
</B03>
<B03>
<C>E</C>
</B03>
<B02>
<B>QA</B>
</B02>
<B03>
<C>WT</C>
</B03>
<B05>
<D>FAD</D>
</B05>
</TRAN>
</ROOT>



My target structure is :

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ROOT>
<TRAN>
<B01>
<A>q</A>
<B02>
<B>A</B>
<B03>
<C>W</C>
</B03>
<B03>
<C>E</C>
</B03>
</B02>
<B02>
<B>QA</B>
<B03>
<C>WT</C>
</B03>
</B02>

<B05>
<D>FAD</D>
</B05>
</B01>
</TRAN>
</ROOT>


I was using for-each loop for the repetitive grp but it is creating 3 nodes for B03 in both occurance of B02.

Regards,
Anirudh.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.