I have 2 xml files and I want to read data from both files in one xsl transformation. I try to read the data from the second file using the document() function, but it does not return any value.
XSL template
<xsl:template name="BuildingList" match="building">
<xsl:variable name="allBuildings" select="document('buildings.xml')/buildings"/>
<xsl:value-of select="$allBuildings" />
</xsl:template>
Buildings.xml structure
<?xml version="1.0" encoding="windows-1251"?>
<buildings>
<building id="First">
<title>Some title</title>
</building>
</buildings>
How can I get the content in order to manipulate it?
EDIT:
All three files are in the same directory. I tried to process the transformation with the following two jQuery plugins:
With either of them the transformation of more than one file is not working.
Using the pluings:
function LoadContent(pageName)
{
var currentPage = pageName+ '.xsl';
$.transform({el:"#information",xml:"pages.xml",xsl:currentPage});
/*$('#information').xsltParser({
xml: 'pages.xml',
xslt: currentPage,
onStart: function() {
//$('#log').append('Preparing... ');
},
onSend: function(url) {
//$('#log').append('Requesting ' + url + '... ');
},
onComplete: function() {
//$('#log').append('Done!');
}
});*/
}
I found out that
document()is not supported in client-side transformation as stated here