Edge browser problem for script elements dynamically added to page
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.
Please register to edit this issue