2

I am working on a digital archive project which contains a multitude of XML documents. In order to transform them all, we employ XSLT. However, the same XSLT transformation that works in IE, Chrome, Firefox, and Safari does not work in Microsoft Edge. It only spits out the text from the XML document, unformatted with the following error message:

HTML1300: Navigation occurred. XML5001: Applying Integrated XSLT Handling. XSLT8690: XSLT processing failed.

I tried a test example of basic XML and XSL files which works by producing the transformed XML, but still cannot find where the digital archive XSLT is breaking down.

Any assistance is appreciated.

Here is the test scenario: http://www.gracethom.com/test/test.xml

Here is one text page of the archive that does not transform successfully in Edge: http://dcl.slis.indiana.edu/petrarchive/content/c001r.xml#rvf001

  • maybe you did not allow active content in edge, see http://stackoverflow.com/questions/10529999/why-xslt8690-xslt-processing-failed-when-processing-local-xml-xslt – wero May 18 '16 at 07:24

1 Answers1

1

As far as I can tell the problem is caused by the attempt (in an included stylesheet) to use

  <msxsl:script language="JScript" implements-prefix="exsl">
    this['node-set'] =  function (x) {
    return x;
    }
  </msxsl:script>

to get MSXML, the XSLT processor used by IE and Edge, to support the exsl:node-set extension function. That code using msxsl:script works in IE but does not seem to be supported in Edge, probably because they disabled msxsl:script for security reasons or because their new, leaner architecture in Edge does not support it (I am guessing about the reasons, I have never seen any documentation on Edge/MSXML saying that msxsl:script is not supported and why). For what it's worth, I have now tried to file that issue on Microsoft Edge at https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7598626/.

There is no easy way out, with stylesheets as complex as you have them and authored by others I guess you need to ask the authors whether they are aware of the Edge problem and are working on a fix or whether they have informed Microsoft about the problem that it is an established XSLT hack to use msxsl:script to enforce exsl:node-set compatibility across XSLT 1.0 processors which is now broken in Edge.

As a quick fix you could try to uncomment the msxsl:script block in the imported stylesheet and then replace

  <xsl:template name="xml-to-string">
    <xsl:param name="node-set" select="."/>
    <xsl:apply-templates select="exsl:node-set($node-set)/*" mode="xml-to-string">
      <xsl:with-param name="depth" select="1"/>
    </xsl:apply-templates>
  </xsl:template>

with

  <xsl:template name="xml-to-string">
    <xsl:param name="node-set" select="."/>
    <xsl:choose>
        <xsl:when test="function-available('msxsl:node-set')">
           <xsl:apply-templates select="msxsl:node-set($node-set)/*" mode="xml-to-string">
             <xsl:with-param name="depth" select="1"/>
           </xsl:apply-templates>
        </xsl:when>
        <xsl:otherwise>
           <xsl:apply-templates select="exsl:node-set($node-set)/*" mode="xml-to-string">
             <xsl:with-param name="depth" select="1"/>
           </xsl:apply-templates>
         </xsl:otherwise>
     </xsl:choose>
  </xsl:template>

I have not tested whether that solves the problem for the particular input document and obviously not whether it breaks things for other input documents.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110