Project

Profile

Help

Support #4732

closed

Upgrading AtomGraph application from Saxon-CE to Saxon-JS 2

Added by Martynas Jusevicius over 3 years ago. Updated about 3 years ago.

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

0%

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

Description

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. I don't need this since this code only handles onsubmit (since Saxon-JS cannot handle it natively), and 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