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

Two file problem.

Subject: Two file problem.
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Thu, 14 Sep 2000 10:21:15 +0100
file problem
problem.

Two xml files

file 1
<fa>
  <a name="a1">3</a>
  <a name="a2">5</a>
  <a name="a3">2</a>
  <a name="new">1</a>
</fa>

file 2
<fb>
  <a name="a1">1</a>

  <a name="a3">1</a>
  <a name="a4">2</a>
</fb>

required output
<res>
   <a name="a1">4</a>
  <a name="a2">5</a>
  <a name="a3">3</a>
  <a name="a4">2</a>
  <a name="new">1</a>
</res>
I.e. I want to sum the corresponding elements to the output file.

Issues with my present solution.
  Using a <for-each> on the input document I can add, to the output
  using
processor:node-set(document(file-other.xml))/fx/a[@name=current()/@name]
  the value of the corresponding element from the other file.

  If  I use file 1 as the main document source, I can catch those
  which match in file 2, but not those unique to file 2 (<a name="new">
in the example.)
  If I use file 2 as the main document source, I can get those 
  which match in file 1, but will miss those which are unique to file 1.

 Can anyone suggest a method of ensuring that I capture in the output
 all the <a> elements from either file, without using more extensions
 if possible. I think its the cup function, but no one has come up 
 with this as an extension even ... or have they?

TIA DaveP


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.