Project

Profile

Help

Bug #3012

In browser, do not always produce HTML elements in result documents when they should be produced

Added by Debbie Lockett over 1 year ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Sprint/Milestone:
-
Start date:
2016-10-28
Due date:
% Done:

100%

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

Description

There are some cases when HTML elements should be constructed, but they are not.

1. When using the transform method destination:"replaceBody"|"appendToBody"|"prependToBody" to add the principal output to the HTML body (as pointed out in https://saxonica.plan.io/boards/5/topics/6589?r=6590#message-6590).

2. When an HTML fragment is generated using xsl:result-document, HTML elements are not produced by xsl:sequence (but they are produced by xsl:copy-of).

History

#1 Updated by Debbie Lockett over 1 year ago

  • Subject changed from In browser, do always produce HTML elements in result documents when they should be produced to In browser, do not always produce HTML elements in result documents when they should be produced

#2 Updated by Debbie Lockett over 1 year ago

When building result trees, elements should always be created using the Context.createElement method (in transform.js). This uses the createElement (or createElementNS) method of the JavaScript Document interface. As long as the document (context.resultDocument) that this method is called on is an HTML document, HTML elements will be produced. So we need to ensure that context.resultDocument is an HTML document in the required cases.

Changes to applyStylesheet method in transform.js:

1. To set context.resultDocument to window.document when using one of the destination options.

2. To ensure that the context is passed as the 3rd arg in the Expr.makeComplexContent call, so that context.resultDocument can be accessed correctly.

#3 Updated by Debbie Lockett over 1 year ago

  • Status changed from New to In Progress

Various unit tests created for this bug (in combination with https://saxonica.plan.io/issues/2944) for the JS unit testing framework in development.

Further tests still required.

#4 Updated by Debbie Lockett over 1 year ago

  • Status changed from In Progress to Resolved

Now marking this as resolved, as more tests have been added, and have not found further issues.

#5 Updated by Debbie Lockett about 1 year ago

  • Fixed in version set to 0.9.1

Bug fix applied in the Saxon-JS 0.9.1 beta release.

#6 Updated by Debbie Lockett about 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100

Bug fix applied in the Saxon-JS 0.9.1 beta release.

#7 Updated by Community Admin 7 months ago

  • Fixed in JS Release set to Saxon-JS 0.9.1
  • Applies to JS Branch 0.9 added
  • Fix Committed on JS Branch 0.9 added

Please register to edit this issue

Also available in: Atom PDF Tracking page