Bug #3727

Edge browser problem for script elements dynamically added to page

Added by Debbie Lockett 9 months ago. Updated 7 months ago.

Start date:
Due date:
% Done:


Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


Using the Windows Edge browser, the JS unit tests which add a script element to the HTML page (using xsl:result-document) are failing. i.e. tests ixsl2/interactive01, 02, 10, 11, 12. The tests work fine in Chrome, Firefox, and Safari.

The problem seems to be that although the script elements are added to the page, they are not executed. So the global methods that are defined in the new script elements are not found.


#1 Updated by Debbie Lockett 9 months ago

This isn't really a bug in Saxon-JS, but rather it seems that the tests misuse xsl:result-document. Inserting script elements using xsl:result-document will not work in all browsers, so it shouldn't be used (and I should add a warning to the documentation).

A work around is to use empty script elements (with IDs) in the skeleton HTML page, and then the content can be added by setting the textContent property of the script Node, using ixsl:set-property. Test interactive03 added to do this (and this works in Edge).

I also tried first adding the script elements and later setting the textContent (test interactive04); but this doesn't work in Edge either.

#2 Updated by Debbie Lockett 9 months ago

  • Status changed from New to In Progress

An alternative work around, which is closer to the original: use empty script elements (with IDs) in the skeleton HTML page, and then use xsl:result-document to add the content. Test interactive05 added (and this works in Edge). This is more like the standard recommended mechanism for adding content to a skeletal HTML page using xsl:result-document.

#3 Updated by Debbie Lockett 8 months ago

  • Status changed from In Progress to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

A note has been added to the documentation (under development/result-documents) about dynamically adding script element content.

#4 Updated by Debbie Lockett 7 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.1.0

Bug fix applied in the Saxon-JS 1.1.0 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page