473,811 Members | 2,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merging XML documents into a single XML file

Hello,

I was wondering if anyone could shed some light on an issue I am
having. I have 3 or 4 xml files which i need to merge onto another xml
file called build_log.xml, which is produced using an ANT Logger. Then
using XSL etc I want to format all of this into a pretty html format!
Does anyone have any sample code they could shove my way??

Many thanks,

Danny Knights

Aug 23 '06 #1
2 1667
da************@ sunderland.ac.u k schreef:
Hello,

I was wondering if anyone could shed some light on an issue I am
having. I have 3 or 4 xml files which i need to merge onto another xml
file called build_log.xml, which is produced using an ANT Logger. Then
using XSL etc I want to format all of this into a pretty html format!
Does anyone have any sample code they could shove my way??

Many thanks,

Danny Knights

You could create an .xsl file which loads teh documents in variables!
Take a xsl tutorial, and i'm sure you will succeed
Aug 23 '06 #2
da************@ sunderland.ac.u k wrote:
Hello,

I was wondering if anyone could shed some light on an issue I am
having. I have 3 or 4 xml files which i need to merge onto another xml
file called build_log.xml, which is produced using an ANT Logger. Then
using XSL etc I want to format all of this into a pretty html format!
Does anyone have any sample code they could shove my way??

Many thanks,

Danny Knights
Have the RefleX !

There is an example here :
http://reflex.gforge.inria.fr/tips.html#N80165D (section "Merging XML
fragments")

You could simply write it like this :
<xcl:document name="myXml">
<doc>
<xcl:for-each name="file" select="{
io:file('file:///path/to')/*[@io:extension=' xml'] }">
<xcl:parse name="fragment" source="{ $file }"/>
{ $fragment }
</xcl:for-each>
</doc>
</xcl:document>
<xcl:transfor m output="file:///path/to/myFile.xml" source="{ $myXml
}" stylesheet="fil e:///path/to/myStylesheet.xs lt"/>

If your XML input files are not in a single directory but under some
subdirectories, you can replace /* by //* (it's XPath applied on a file
object that behaves like an XML object)

There are other runnable examples in the tutorial section
http://reflex.gforge.inria.fr/tutorial.html

--
Cordialement,

///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
Aug 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2677
by: Daryl Middleton | last post by:
Can python be used to merge pdf documents into a single pdf file so that I do not have to manually insert each one. Thanks
1
1970
by: Mael Guillemot | last post by:
Hi, I have one xml looking like this: ========================= <video> <shot id="1"> <timestampbegin>000030.90</timestampbegin> <feature>blabla</feature> <timestampbegin>000045.20</timestampbegin>
3
2540
by: William Ahern | last post by:
I'm looking for resources on splitting and merging XML trees. Specifically, on methods to pare large XML documents into smaller documents which can be merged later. Off of the top of my head, I can envision unions of node sets, and unions of node text. But I know there's much more to the subject than that, if not more alternatives than greater technical detail. TIA,
0
2902
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is loaded with historical data read from an XML file. The second dataSet has current data filled from a dataGrid.
3
1892
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best, easiest, most efficient way of merging the 2 XML Documents? Can I use DataSet.Merge() facility in ADO.NET?? Any pre-requisites? Any other suggestions?
0
6301
by: mharris | last post by:
I need help with merging two Word documents into one through C# code. The problem isn't so much getting the documents put into one as it is maintaining the appropriate formatting, or rather reformating, after the merge. This is a full description of my needs. I have a C# class library that creates two Crystal Reports, and then exports them to the harddrive as Word documents. One's orientation is landscape, the other is portrait. I then...
5
6485
by: David Lozzi | last post by:
Hello, this is a repost of a previous post of mine from today. I need to export multiple documents (doc, xls, ppt, jpg) and crystal reports to a single PDF file. I know how to export a single Crystal Report to PDF and it works quite nicely using the Response.ContentType = "application/pdf". However, the users have an option to include other documents/reports in their report that are associated with the report. For example: User previews a...
3
1670
by: CarrieZ | last post by:
I'm trying to help out our education manager. He has a fancy Access database that he has been keeping in My Documents. One of its features is that it has a couple of buttons that call Macros that then call tables that are built on the fly off of queries. This new table is then ported into Word into an existing document and is mail-merged in. This works fine on his PC using the following line in the RunApp command line: winword.exe...
0
2356
by: Albert-jan Roskam | last post by:
Hi John, Thanks! Using a higher xlrd version did the trick! Regarding your other remarks: -yep, input files with multiple sheets don't work yet. I kinda repressed that ;-) Spss outputs only single-sheet xls files, but I agree it's nicer if the programs works in other cases too. -and no, I don't intend to use data fields. Wouldn't it be easier to convert those to string values if I ever came across them? Thanks again! Albert-Jan
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.