Discussion Locked

XSLT: Want to merge data from 2 XML files

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to develop an XSL stylesheet that will spit out XHTML using information from 2 separate xml files.

One XML file contains entities like this

The other XML contains entities like this

I can cut and paste the entities from the first XML file into the second file and get the output I want using the following:

My question is how to do this without having to manually merge the two xml files together. Can I get the stylesheet to read in the required data from the first file before processing the second file?

4 replies

by steveturoff

You can use the document() function to access another file. Suppose you are running xsltproc from the command line and your command looks like:

xsltproc file1.xml stylesheet.xslt

In stylesheet.xslt, you can access nodes in file2.xml by doing something like:

This discussion is closed to new replies.