Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

xsl:include doesn't work when transforming XML with XSL using JavaScript API...

$
0
0
Hi!

I'm trying to use <xsl:include> or <xsl:import> to include an external XSL stylesheet. To perform the transmormations I use that code:


Code Snippet
xml_document=new ActiveXObject('MSXML2.DOMDocument.6.0');
xsl_template=new ActiveXObject('MSXML2.XSLTemplate.6.0');
freethreaded_xml=new ActiveXObject('MSXML2.FreeThreadedDOMDocument.6.0');

xml_document.async=false;
freethreaded_xml.async=false;

xml_document.load(xml_path);
freethreaded_xml.load(xsl_path);

xsl_template.stylesheet=freethreaded_xml;
xsl_processor=xsl_template.createProcessor();
xsl_processor.input=
xml_document;
xsl_processor.transform();
node.innerHTML=xsl_processor.output;


That code works perfectly, unless xsl:include or xsl:import is used in the stylesheet.
External stylesheet contains some generic templates, which I' trying to call from the main template. Unfortunately IE throws an error "Named template 'time' does not exist in the stylesheet".
By the way this works in FF2+ and Opera 9.5 (Safari, MSIE and Opera 9.2 and below do not work). If someone has general workaround for any browser, please share!

thanks!

Viewing all articles
Browse latest Browse all 3527

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>