Merge two different xml files into one

Kjetil Finsrud

Usenet Archive
Joined
Nov 23, 2004
Messages
1
Reaction score
0
I have two xml files that I wish to join/merge into one. The first file (sp.xml)includes information about study programmes and the second one includes information about each course. The only thing I want from file number two(course.xml) abouts courses is credits. credits pr. course. I am using xsl to show the data.

Here's the first xml file(sp.xml):
<studyinfo>
<studyprogramme>
<name>Bachelor Agroecology</name>
<language>Norwegian</language>
<code>B-GEOM</code>
<studyoptions>
<coursecomposition>
<coursecombination level ="1">
<coursecombinationcode>B-GEOM-OBL</coursecombinationcode> <coursecombinationame>Geomatikk</coursecombinationame> <course> <courseid> <coursecode>STAT100</coursecode> <institutenr>192</institutenr> </courseid> <coursename>Statistics</coursename> <semester>1</semester> <status>O</status>
--> here I want credits from the other xml file(course.xml)! </course> etc. </coursecombination> </coursecomposition> </studyoptions> </studyprogramme> </studyinfo>

Here's file number two(course.xml):
<studyinfo>
<courses>
<course>
<courseid>
coursecode>STAT100</coursecode>
<institutenr>192</institutenr>
</courseid>
<coursename>Statistics</coursename>
<semester>1</semester>
<status>O</status>
<credits>10</credits> ---->I want this info into my first file(sp.xml) </course> </courses> </studyinfo>

etc.

I loop through the document number one (sp.xml)and I have tried using document function, but only get the credits for the first course! The credits for the rest of the courses are from the first course in the course.xml file, therefore the same.

Also tried <xsl:copy of select="">, but with no luck yet.

Have you any suggestions on a solution for this problem?
 

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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top