Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Modify some text elements copying the structure

From: "nick public" <nickpubl@--------->
To:
Date: 1/4/2009 10:49:00 AM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent