Merging XML documents into a single XML file

D

daniel.knights

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
 
T

Tjerk Wolterink

(e-mail address removed) 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
 
P

Philippe Poulard

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:transform output="file:///path/to/myFile.xml" source="{ $myXml
}" stylesheet="file:///path/to/myStylesheet.xslt"/>

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 !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top