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

xsl: parsing through specific child nodes

Subject: xsl: parsing through specific child nodes
From: "Mohit Anchlia" <mohitanchlia@xxxxxxxxx>
Date: Fri, 5 Sep 2008 10:17:44 -0700
 xsl: parsing through specific child nodes
I need to change only certain child nodes to certain values. Could somebody
tell me how to do that. I have 2 xml docs and I need to parse through both
and change only certain nodes. I'll explain with an eg:

XML 1:
<ZZ>
<ABC>XXXXX<ABC>
<DEF>YYYYYY<DEF>
<ZZ>

XML 2:
:
<ZZ>
<ABC>AAAAA<ABC>
<DEF>FFFFFFF<DEF>
<ZZ>

So when I am merging I need to check if <DEF> has YYYYY then change it to
DDDDD, or if <DEF> has GGGGGG then change it to EEEEEE. Values are known
upfront so that means mapping could be hard coded within "if" statement. So
after the 2 docs get merged it should look like.

<Body>
<ZZ>
<ABC>XXXXX<ABC>
<DEF>DDDDD<DEF>
<ZZ>
<ZZ>
<ABC>AAAAA<ABC>
<DEF>FFFFFFF<DEF>
<ZZ>
</Body>
--
one more question, for above scenario should I be using xsl:key for
mapping purposes. for eg: If I want to change value from A to B for
certain node types?

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