Project

Profile

Help

Feature #3670

Implement more transform API options

Added by Debbie Lockett 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Low
Sprint/Milestone:
-
Start date:
2018-02-14
Due date:
% Done:

100%

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

Description

Documentation says "Further options will be implemented in due course."

e.g. for XSLT 3.0 call-template invocation we need templateParams.

Refer to the specification for fn:transform() for ideas of what else is missing (https://www.w3.org/TR/xpath-functions-31/#func-transform) - e.g. tunnelParams; and initialMatchSelection (for apply-templates invocation).

History

#1 Updated by Debbie Lockett 5 months ago

Note that templateParams and tunnelParams have already been implemented on the trunk branch (from 2017-10-27). Looks like the relevant code should just copied over to the 1.0 branch. JS unit tests are needed.

Something has gone awry with transform option "destination". The documentation says that the default is "application"; but looking at the code this no longer seems to be the case (i.e. if destination is not set then we don't end up down the same path [or get the same results] as when destination is "application"). Also we now use the value "native" internally; should this also be an option for users? This has always been an undertested area...

#2 Updated by Debbie Lockett 5 months ago

Various JS unit tests added to test use of templateParams, and tunnelParams. Also added a number to test initialFunction and functionParams (these have been available since Saxon-JS 1.0.1, but had no JS unit tests).

#3 Updated by Debbie Lockett 5 months ago

Implemented templateParams and tunnelParams on 1.0 branch (essentially copying relevant code from 2.0 branch); with some issues resolved on both branches (e.g. when the context.localParams and context.tunnelParams objects are set up using setTemplateParams method, always use 'Q{uri}local' EQName form for keys. This relates to bug 3479).

Also resolve issues with initialFunction:

  1. Ensure context.localVars object values are always Arrays

  2. Reset c2.tempOutputState inside event handlers (so that event handling templates can be used in stylesheets which are invoked using call function invocation).

Fix default for destination option.

#4 Updated by Debbie Lockett 3 months ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

Marking this as resolved, as I think we have all the transform options we want for now. With more tests, and relevant documentation updates.

A separate issue #3755 has been raised about changes required for the API for Saxon-JS 2.0.

#5 Updated by Debbie Lockett 2 months ago

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

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

Please register to edit this issue

Also available in: Atom PDF Tracking page