Project

Profile

Help

Bug #4734

closed

SaxonJS.transform nonInteractive option does not work

Added by Debbie Lockett about 4 years ago. Updated over 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.

Please register to edit this issue

Also available in: Atom PDF Tracking page