I am trying to transform XML to HTML using XSLT.
Usualy the code I use worked for most cases, but this time it doesn't for the 5 firsts documents on Internet Explorer 11.
When i try to do the transformation using Chrome, it works for all documents in the XML.
XML & XSLT documents:
-
XSLT : http://pastebin.com/ApUcG0rQ
IE 11 Code:
var srcTree = new ActiveXObject("Msxml2.DOMDocument.6.0"); srcTree.async=false; srcTree.load(xml); var xsltTree= new ActiveXObject("Msxml2.DOMDocument.6.0"); xsltTree.async = false; xsltTree.load(xsl); document.write( srcTree.transformNode(xsltTree) );
i even tried ( with the same result )
xmldoc = new ActiveXObject( "Msxml2.DOMDocument.3.0" ); xsldoc = new ActiveXObject( "Msxml2.FreeThreadedDOMDocument.3.0" );
Chrome Code:
xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet( xsl ); result = xsltProcessor.transformToFragment( xml, document ); serializer = new XMLSerializer(); str = serializer.serializeToString( result ); document.write( str );
No comments:
Post a Comment