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

Merging documents with similar structure

Subject: Merging documents with similar structure
From: "Troye Stonich" <tstonic@xxxxxxx>
Date: Mon, 12 Dec 2005 21:30:24 -0600
troye stonich
I am using Adobe's Livecycle platform to create PDF forms using XFA. I have two files with the 'same'
structure and I need to merge the elements at a certain level into one document. The structure is as
follows:



File1.xdp: <subform name="TopmostSubform"> <subform name="SecGroup"> <subform name="Section"> <field name="Do" /> <draw name="Ra" /> <field name="Mi" /> </subform> <subform name="Section"> <field name="Do" /> <draw name="Ra" /> <field name="Mi" /> </subform> ... </subform> <subform name="SecGroup"> <subform name="Section"> <field name="Do" /> <draw name="Ra" /> <field name="Mi" /> </subform> <subform name="Section"> <field name="Do" /> <draw name="Ra" /> <field name="Mi" /> </subform> ... </subform> ... </subform>



File2.xdp:
<subform name="TopmostSubform">
<subform name="SecGroup">
 <subform name="Section">
  <draw name="Fa" />
 </subform>
 <subform name="Section">
  <draw name="Fa" />
 </subform>
</subform>
<subform name="SecGroup">
 <subform name="Section">
  <draw name="Fa" />
 </subform>
 <subform name="Section">
  <draw name="Fa" />
 </subform>
</subform>
</subform>



Merged.xdp needs to be:
<subform name="TopmostSubform">
<subform name="SecGroup">
 <subform name="Section">
  <field name="Do" />
  <draw name="Ra" />
  <field name="Mi" />
  <draw name="Fa" />
 </subform>
 <subform name="Section">
  <field name="Do" />
  <draw name="Ra" />
  <field name="Mi" />
  <draw name="Fa" />
 </subform>
</subform>
<subform name="SecGroup">
 <subform name="Section">
  <field name="Do" />
  <draw name="Ra" />
  <field name="Mi" />
  <draw name="Fa" />
 </subform>
 <subform name="Section">
  <field name="Do" />
  <draw name="Ra" />
  <field name="Mi" />
  <draw name="Fa" />
 </subform>
</subform>
</subform>


Basically, all elements from file2.xdp under this level: subform[@name='TopmostSubform']/subform[@name='SecGroup']/subform[@name='Section']

Need to be added to File1.xdp at the same level

I've read many posts from various lists on merging and can't seem to get anything to work.
Unfortunately, none of the nodes in the xml files have a "unique" id, otherwise I would use the Oliver Becker
technique at http://www.informatik.hu-berlin.de/~obecker/XSLT/#merge.


I am using Saxon8 as my processor and would appreciate any help in merging these documents.

Thanks!

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.