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

Help with moving nodes from one tag to a new

Subject: Help with moving nodes from one tag to a new
From: "David Larsson" <laserallan@xxxxxxxxx>
Date: Thu, 3 Jan 2008 11:47:51 +0100
 Help with moving nodes from one tag to a new
Hi!

Sorry for the somewhat confusing topic but this is what I'm would like
to accomplish.

When I designed an xml-format some time ago I made a mistake
organizing it like this:
<Root>
   <RandomTag1>data</RandomTag1>
   <RCTest1>data</RCTest1>
   <RCTest2>data</RCTest2>
   <RCTest3>data</RCTest3>
   <FGTest1>data</FGTest1>
   <FGTest2>data</FGTest2>
   <FGTest3>data</FGTest3>
   <RandomTag2>data</RandomTag2>
   <RandomTag3>data</RandomTag3>
</Root>

I would like to use the following organization instead:
<Root>
   <RandomTag1>data</RandomTag1>
   <RC>
       <Test1>data</Test1>
       <Test2>data</Test2>
       <Test3>data</Test3>
   </RC>
   <FG>
       <Test1>data</Test1>
       <Test2>data</Test2>
       <Test3>data</Test3>
   </FG>
   <RandomTag2>data</RandomTag2>
   <RandomTag3>data</RandomTag3>
</Root>

I wonder whether it would be possible to write an xsl transform that
does this particular transformation so I can version check old files
and transform them to the new format for backward compatibility rather
than support reading both the old and the new format in my program.
I'm not looking for some general solution that automatically
understands that RC and FG are two suitable prefix to create a parent
node for, this is something I can specify myself.
I did some initial tests, but I realized that I don't know enough xsl
to do this kind of transformation, but if someone can point me in the
right direction (or perhaps convince me that this kind of transform is
not possible with xsl) I would be very happy.

Regards
/David Larsson

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.