Project

Profile

Help

Bug #4734

closed

SaxonJS.transform nonInteractive option does not work

Added by Debbie Lockett over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Sprint/Milestone:
-
Start date:
2020-09-14
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

See original problem raised in Issue #4732.

When more than one SaxonJS.transform call is used in an application, event listeners are registered again; and it seems that use of "nonInteractive": true has no effect:

As explained on the mailing list, I am trying to replicate the behavior of Saxon-CE's updateHTMLDocument() with Saxon-JS 2. This code is invoked from a JS onsubmit handler in order to replace the content of the submitted form:

SaxonJS.transform({
    "stylesheetLocation":
"https://localhost:4443/static/com/atomgraph/linkeddatahub/xsl/client.xsl.sef.json",
    "initialMode":
"Q{https://w3id.org/atomgraph/linkeddatahub/domain#}ConstructViolation",
    "logLevel": 10,
    "sourceNode": html, // HTML document node from a jqXHR response
    "templateParams": {
        "submitted-form": form // the onsubmit target
    },
    "destination": "raw",
    "nonInteractive": true
}, "async");
<xsl:template match="html" mode="apl:ConstructViolation">
    <xsl:param name="submitted-form" as="element()"/>
    <xsl:variable name="violation-form" as="element()">
    ...
    </xsl:variable>

    <xsl:result-document href="#{$submitted-form/@id}" method="ixsl:replace-content">
        <xsl:copy-of select="$violation-form/*"/>
    </xsl:result-document>
</xsl:template>

However with each invocation it looks like the ixsl: event listeners are being registered again. [...] there's another "main" SaxonJS.transform() that already has registered the listeners. I thought I could switch this off using "nonInteractive": true, but it does not seem to have the desired effect.

Actions #1

Updated by Martynas Jusevicius over 3 years ago

Do you need a test case for this or were you able to reproduce it?

Actions #2

Updated by Debbie Lockett over 3 years ago

  • Subject changed from Events registered multiple times when more than one SaxonJS.transform call to SaxonJS.transform nonInteractive option does not work
  • Category changed from Internals to API
  • Status changed from New to In Progress

The SaxonJS.transform option nonInteractive is simply not fully implemented, and was untested.

Currently the option is not being processed during checkOptions, so it is simply lost. Also subsequent options checks must use dot notation to access the property, not bracket notation; else these won't work following renaming (from Closure compiling).

JS2 unit tests being added (API/nonInteractive01, etc.)

Actions #3

Updated by Debbie Lockett over 3 years ago

  • Status changed from In Progress to Resolved
  • Fix Committed on JS Branch 2.0 added

Code fix, and JS2 unit tests, committed.

Actions #4

Updated by Community Admin about 3 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (2.0)
Actions #5

Updated by Community Admin about 3 years ago

  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (2.0)
Actions #6

Updated by Debbie Lockett about 3 years ago

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

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

Please register to edit this issue

Also available in: Atom PDF Tracking page