Project

Profile

Help

Feature #6303

closed

`xsl:result-document` method that replaces `outerHTML`

Added by Martynas Jusevicius almost 1 year ago. Updated 3 days ago.

Status:
Closed
Priority:
Normal
Category:
IXSL extensions
Sprint/Milestone:
-
Start date:
2023-12-22
Due date:
% Done:

100%

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

Description

Currently <xsl:result-document method="ixsl:replace-content"> replaces the equivalent of innerHTML.

Therefore I often find myself doing stuff like this:

<xsl:variable name="row" as="node()*">
    <xsl:apply-templates select="$resource" mode="bs2:Row"/>
</xsl:variable>

<xsl:result-document href="?." method="ixsl:replace-content">
    <xsl:copy-of select="$row/*"/>
</xsl:result-document>

Whereas it would be much more convenient to have a new method such as ixsl:replace-self that would replace outerHTML. My example would look much simpler then:

<xsl:result-document href="?." method="ixsl:replace-self">
    <xsl:apply-templates select="$resource" mode="bs2:Row"/>
</xsl:result-document>
Actions #1

Updated by Martynas Jusevicius 8 months ago

Looks like the DOM equivalent of this is Element.replaceWith()

Actions #2

Updated by Debbie Lockett 7 months ago

  • Status changed from New to Resolved
  • Assignee set to Debbie Lockett
  • Applies to JS Branch Trunk added
  • Fix Committed on JS Branch Trunk added

New xsl:result-document method ixsl:replace-element implemented for SaxonJS 3.

Implementation, tests (broswer/iss6303 and nodejs/iss6303), and documentation updates committed on main branch.

Actions #3

Updated by Debbie Lockett 3 days ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to SaxonJS 3.0

Bug fix applied in the SaxonJS 3.0.0-beta1 preview release.

Please register to edit this issue

Also available in: Atom PDF Tracking page