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

Modify some text elements copying the structure

Subject: Modify some text elements copying the structure
From: "nick public" <nickpubl@xxxxxxxxx>
Date: Sun, 4 Jan 2009 11:49:00 +0100
 Modify some text elements copying the structure
Hi people.
I have the following need:
given a complicated source XML, I have to change in output the text
element for same nodes mainteinig the source structure.
An example can be this in which I want to change the <elem2> text values.

===================== SOURCE =====================
<?xml version="1.0" encoding="utf-8"?>
<root>
 <level1 name="">
   <elem1>element</elem1>
   <level2a>
     <elem2>sub element1</elem2>
   </level2a>
   <level2b>
     <elem2>sub element2</elem2>
   </level2b>
 </level1>
</root>

===================== TARGET =====================
<?xml version="1.0" encoding="utf-8"?>
<root>
 <level1 name="">
   <elem1>element</elem1>
   <level2a>
     <elem2>modified element1</elem2>
   </level2a>
   <level2b>
     <elem2>modified element2</elem2>
   </level2b>
 </level1>
</root>

Every since the SOURCE structure is complex, the XSLT cannot build
"manually" the TARGET structure. Should be useful copy+copy-of the
source structure in target structure and the modify the values but,
after same test, seems not possible because, when I want to operate on
copy+copy-of result-tree, this is not yet available - because in
memory too.

For me should be acceptable operate in several steps, for example,
step1 -> copy the source struct in target struct, step2 -> modify the
values.
Could you help me?

Thanks a lot and ciao.
Nicola

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.