Project

Profile

Help

Support #6170

closed

Which XSLT instructions actually change the context-node before processing the children?

Added by Gerben Abbink over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2023-08-15
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I am looking for all the XSLT instructions that actually change the context-node before processing the children.

According to [[https://www.w3.org/TR/xslt-30/#additional-dynamic-context]] , these are all the elements and attributes:

  • accumulator/@match
  • analyze-string/@select
  • apply-templates/@select
  • for-each/@select
  • for-each-group/@group-adjacent
  • for-each-group/@group-by
  • for-each-group/@group-ending-with
  • for-each-group/@group-starting-with
  • for-each-group/@select
  • key/@match
  • number/@count
  • number/@from

How can I be sure that this is the correct list?

Actions #1

Updated by Michael Kay over 1 year ago

This isn't actually the best place for questions about the W3C specification, but I'll do my best...

There are clearly omissions from your list, such as xsl:iterate , xsl:merge, and xsl:sort. The list you point to is primarily about parts of the dynamic context other than the context item itself.

I don't think there is any central list of things that change the context item. §5.3.3.1 talks about the principles, but says:

In other cases (for example, where the containing element is xsl:sort, xsl:with-param, or xsl:key), the rules are given in the specification of the containing element.

I think there are one or two cases that are still underspecified in the XSLT 3.0 spec, for example it's not entirely clear what the context is for evaluating xsl:param/@select.

Actions #2

Updated by Philip Fearon over 1 year ago

For changing the context node, do these count also?

xsl:copy with @select

xsl:perform-sort

xsl:merge-source

xsl:source-document

Actions #3

Updated by Gerben Abbink over 1 year ago

Can I tell from the Saxon source code which instructions change the
context-node?

On Tue, Aug 15, 2023 at 9:39 PM Saxonica Developer Community <
> wrote:

Actions #4

Updated by Michael Kay over 1 year ago

You can look for calls of XPathContext.setCurrentIterator()

Actions #5

Updated by Michael Kay over 1 year ago

  • Status changed from New to Closed

Please register to edit this issue

Also available in: Atom PDF