[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT to conver flat XML to Heirarchy XML

Subject: XSLT to conver flat XML to Heirarchy XML
From: <sreekanth.gangula@xxxxxxxxx>
Date: Wed, 27 Apr 2005 08:24:29 +0530
xslt flat heirarchy
Hi ,
>  I have an XML which is flat,
>
><?xml version="1.0" encoding="utf-8" ?>
>
><ns:MT_Test xmlns:ns="<http://centrica/Test>http://Centrica/Test">
>  <RECSETNAME xmlns:ns="<http://centrica/Test>http://Centrica/Test">
>    <Record>
>        <keyfieldValue>"HEADR"</keyfieldValue>
>        <fieldValue>"CDJOB"</fieldValue>
>        <fieldValue>"TRA"</fieldValue>
>    </Record>
>
>    <Record>
>        <keyfieldValue>"TRANS"</keyfieldValue>
>        <fieldValue>"DATA"</fieldValue>
>        <fieldValue>"EXCHG"</fieldValue>
>        <fieldValue>"EXCH"</fieldValue>
>    </Record>
>
>    <Record>
>        <keyfieldValue>"MTPNT"</keyfieldValue>
>        <fieldValue>74842606</fieldValue>
>    </Record>
>
>    <Record>
>        <keyfieldValue>"ADDRS"</keyfieldValue>
>        <fieldValue>"MTRPT"</fieldValue>
>        <fieldValue>"BRITISH TELECOM"</fieldValue>
>    </Record>
>
>    <Record>
>        <keyfieldValue>"ASSET"</keyfieldValue>
>        <fieldValue>"INSTL"</fieldValue>
>        <fieldValue>"METER"</fieldValue>
>    </Record>
>
>    <Record>
>        <keyfieldValue>"METER"</keyfieldValue>
>        <fieldValue>"T"</fieldValue>
>    </Record>
>
>  </RECSETNAME>
></<ns:MT_Test>
>
>All the data is store under the record structure, based on the
>keyFieldValue i have to generate the target node.
>
>my Target XML should look like:
>
><HEADR>
>   <fieldValue>"CDJOB"</fieldValue>
>   <fieldValue>"TRA"</fieldValue>
>   <TRANS>
>     <fieldValue>"DATA"</fieldValue>
>     <fieldValue>"EXCHG"</fieldValue>
>     <fieldValue>"EXCH"</fieldValue>
>
>     <MTPNT>
>       <fieldValue>74842606</fieldValue>
>
>       <ADDRS>
>          <fieldValue>"MTRPT"</fieldValue>
>          <fieldValue>"BRITISH TELECOM"</fieldValue>
>       </ADDRS>
>
>       <ASSET>
>          <fieldValue>"INSTL"</fieldValue>
>          <fieldValue>"568"</fieldValue>
>
>          <METER>
>             <fieldValue>"T"</fieldValue>
>          </METER>
>       </ASSET>
>     <MTPNT>
>   </TRANS>
></HEADR>
>
>
>
>The logic for generating:
>
>   loop through the records in sorce xml,
>
>    Base on the key value generate the note in the tareget XML, The
>problem here is i am not sure how to insert the nodes as a children in
>the targt.
>
>
>
>Could anyone please help.
>
>
>
>Regards
>
>Sreekanth



Confidentiality Notice

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
Mailadmin@xxxxxxxxx immediately
and destroy all copies of this message and any attachments.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.