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

Replacing matching values with values from another do

Subject: Replacing matching values with values from another document?
From: "Edmund Mitchell" <emitchell@xxxxxxxx>
Date: Mon, 5 Mar 2007 16:26:19 -0800
 Replacing matching values with values from another  do
Hi all,

Can't seem to wrap my head around a starting point.  I apologize for asking,
because it feels like a solution should be obvious to this one, but I'm
drawing a blank.

More or less an identity transform on docA, execpt where I find and element
name match in doc B.  In that case, element &/or att values from docB
overwrite their counterparts in docA.
I haven't seem sample xml yet, but I'm told the docs will be both mostly
flat and extremely similar, so I'm working on the following "guess sample":

[docA.xml]

<docA>
   <a><a/>  
   <b>fred</b>
   <c att="value1"/>
   <e>  <-- no "override" in docB, so it comes forward into the result
</docA>

[docB.xml]

<docB>
   <a/>             <-- no need to change docA
   <b>ethel</b>     <-- "fred" in docA would have to be changed to "ethel"
   <c att="value2"/>  <-- "value1" in docA has to become "value2"
   <d att="foo"> doesn't match </d>  <-- dropped on floor, no element name
match
</docB>

I checked Dave Pawson's great FAQ, but couldn't seem to adapt any example.
XSLT 1 or 2 is just fine; using saxon 8.9.

Thanks,

Edmund

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.