XML : IE11 - Convert XML to HTML using XSLT in Javascript don't work in all case

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:

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 );    

Log result

enter image description here

No comments:

Post a Comment