Since the release of Chrome 56.0.2924 there are reports of a “No XSL output” error when working with Xopus.

 

The error started happening because the exsl:node-set function in Chrome 56 no longer works with an empty parameter.

To work around this issue you should provide a script to prevent transformation of XML using exsl:node-set, then make sure Xopus calls this script.

  1. Create a JavaScript file (for example, fixForChrome56.js) in your “xopus” folder with the following content:
(function fixForChrome56(global) {
                global.XSLTProcessor.prototype.addParameter = function(name, value) {
                               if (value !== null && value !== undefined) {
                                               this.setParameter(null, name, value);
                               } else {
                                               this.removeParameter(null, name);
                               }
                };
}(window));

 

  1. Open xopus.html from the same folder and modify it in the following way:
  • Remove the node that defines core.js, i.e these lines of code:
<script type="text/javascript">
        setTimeout(function () {
                       var s = document.createElement("script");
                       s.setAttribute("type", "text/javascript");
                       s.setAttribute("charset", "utf-8");
                       s.setAttribute("src", "core.js");
                       document.body.appendChild(s);
        }, 42)
</script>
  • Add the following before the closing body tag (</body>):
<script type="text/javascript" charset="utf-8" src="core.js"></script>
<script type="text/javascript" charset="utf-8" src=" fixForChrome56.js"></script>

where fixForChrome56.js is the name of the JavaScript file created in Step 1.

 

You can download examples of fixForChrome56.js and modified xopus.html in zip file here.

 

Be aware that this is a workaround and the Xopus team plans to provide a proper fix as part of a future release.

Anonymous
  • We also found the same problem as Niels, using his modified function worked.

    Thanks Niels!

  • We've had to modify this function as we have have some XSL templates which use parameter values that we not getting passed correctly and outputting [object DocumentFragment] instead of the real value.

    Here's our amended code:

    (function fixForChrome56(global) {

       if (!global.XSLTProcessor) return;

       global.XSLTProcessor.prototype.addParameter = function (name, value) {

           if (value !== null && value !== undefined) {

               if (value.nodeType === 11) { // document fragment

                   const div = document.createElement('div');

                   div.appendChild(value.cloneNode(true));

                   const html = div.innerHTML;

                   this.setParameter(null, name, html);

               } else {

                   this.setParameter(null, name, value);

               }

           } else {

               this.removeParameter(null, name);

           }

       };

    }(window));