Project

Profile

Help

Bug #1508

closed

Issue with switching the global context item to the HTML document within an ixsl:event template

Added by Philip Fearon over 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
2012-05-02
Due date:
% Done:

100%

Estimated time:
Platforms:

Description

The context item within an ixsl:event template switches to the matching node which may either be the event target node or the first matching ancestor of the target node. Such a template works effectively as a new transform, so all global variables are re-evaluated, the context item for global variables in this case is the document node of the html page hosting the event node. Likewise, the root expression '/' will return the host document node.

This behaviour, where context is switched, is intentional and helpful when writing to the HTML page in response to a user event, it's also reasonably intuitive. There is an issue, however: if a source document parameter was set in the initial transform, no reference to this is available within an ixsl:event template (global variables are re-evaluated). The proposed solution for this is to provide an ixsl:source() function that will always return the document node of the source for the original transform, or return an empty sequence if this was not set.

Please register to edit this issue

Also available in: Atom PDF