473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

merge of 2 xml files

Ive tried so many things that it drives me crazy: a want to merge / join 2
xml files like this:

merge.xml:

<?xml version="1.0"?>
<merge>
<appxml>testapp.xml</appxml>
<userxml>user.xml</userxml>
</merge>

testapp.xml:

<app name="testapp" lifetime="900">
<mainmenu>
<menu id="1" caption="test"/>
<menu id="2" caption="another test"/>
</mainmenu>
<forms>
<testform autosize="1"/>
<testform2 autosize="0"/>
</forms>
</app>

user.xml:

<app lifetime="100">
<mainmenu>
<menu id="2" caption="my test"/>
<menu id="3" caption="my menu"/>
</mainmenu>
<forms>
<testform2 autosize="1"/>
</forms>
</app>

the result must be:

<app name="testapp" lifetime="100">
<mainmenu>
<menu id="1" caption="test"/>
<menu id="2" caption="my test"/>
<menu id="3" caption="my menu"/>
</mainmenu>
<forms>
<testform autosize="1"/>
<testform2 autosize="1"/>
</forms>
</app>

What i have so far:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="merge" >

<xsl:variable name="app_xml" select="string(appxml)" />
<xsl:variable name="user_xml" select="string(userxml)" />

<xsl:call-template name="domerge">
<xsl:with-param name="app_nodes" select="document($app_xml)" />
<xsl:with-param name="user_nodes" select="document($user_xml)" />
</xsl:call-template>

</xsl:template>

<xsl:template name="domerge">
<!-- what the heck must be here? -->
</xsl:template>

</xsl:stylesheet>

Who can help, give a hint or a pointer?

Any help appriciated

John
Jul 20 '05 #1
0 1948

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

Similar topics

1
by: Luke Airig | last post by:
I have two xml files that I need to merge on their common field (date_time). The merged output file needs to have the date_time field and all fields from both of the two input files. I am using...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
0
by: Shrage H. Smilowitz | last post by:
Hi, I have created a setup project in vs.net, i have included several merge modules, but when i test the installation on my development machine i dont want the uninstall to remove the files that...
8
by: mesterak | last post by:
I'm trying to write a text log file processor but am having significant performance issues. * On average, there are about 100-200 files to process each file being about 1MB in size. * Typically...
8
by: ilikesluts | last post by:
Hi Group, I'm new to XML, here is my question: Would it be possible to write an algorithm that takes in two XML documents with the only condition being that they have the same root element? ...
1
by: mjobbe | last post by:
I have an installer that requires three merge modules (ATL, CRT, and MFC), and after adding them in, I get the following warnings when I build the MSI: WARNING: Two or more objects have the same...
4
by: Tom Jones | last post by:
I have an application that was originally built using Visual Studio 2003 that I upgraded to Visual Studio 2005. When I attempt to build the *.msi file in the deployment project, I am getting a...
7
by: giladp1 | last post by:
I found Albert Kallal's great "Super easy Word Merge" code in his site at: http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html Thanks Albert so much for sharing this. I am looking...
0
by: Claire | last post by:
Hi, I developed an application that uses Crystal Reports in visual studio 2005 then ported the whole application to VS2008. My original setup/deployment application (created within visual studio)...
1
by: cristalink | last post by:
Hi, I have MS Visual Studio 2008 both Pro and Dev Team Edition SP1 installed. I've compiled a managed C++ .DLL which automatically had a manifest embedded, with the following dependency:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.