I have 2 xml files which I need to merge together using a style sheet
...
You should be replace your line as below:-
<xsl:param name="ApplicationData" select="/"/>
<xsl:param name="MetricList"/>
with this below line one:
<xsl:variable name="Application_Data" select="document('Application_Data.xml')/ApplicationData"/>
<xsl:variable name="'Metric_List" select="document('Application_Data.xml')/MetricList"/>
i think this may help you..
Given the following input files:
ApplicationData.xml
<?xml version="1.0" ?>
<ApplicationData>
Whatever data you have in here.
</ApplicationData>
MetricList.xml
<?xml version="1.0" ?>
<MetricList>
Whatever list you have in here.
</MetricList>
AssessmentInput.xml
<?xml version="1.0" ?>
<AssessmentInput />
the following transformation merge.xsl applied to AssessmentInput.xml
<?xml version="1.0" ?>
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/AssessmentInput">
<xsl:copy>
<xsl:copy-of select="document('ApplicationData.xml')" />
<xsl:copy-of select="document('MetricList.xml')" />
</xsl:copy>
</xsl:template>
</xsl:transform>
produces the correct output of
<?xml version="1.0" encoding="UTF-8"?>
<AssessmentInput>
<ApplicationData>
Whatever data you have in here.
</ApplicationData>
<MetricList>
Whatever list you have in here.
</MetricList>
</AssessmentInput>