This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In section 19.8.9.3, Streamability of the current() function, there's no statement as to what the outcome is if none of the conditions in rules 1, 2, or 3 apply.
Note also that rule (1) talks of the outermost containing XPath expression, which doesn't really allow for use of current() within a pattern. Test case stream-200 (in test set source-document) uses the following within a streamable accumulator: match="part-name/text()[$selected-parts = current()]" To establish that this is streamable, we need to establish that the static type of current() is a text node. There is nothing in the static typing rules to achieve this. We can make it guaranteed-streamable by writing it as match="part-name/text()[$selected-parts = current() treat as text()]" but this seems a little unfortunate.
Proposed resolution: Explanations in "[]", which may become notes in the spec if appropriate. (1) Add special rules for the static type of a call to current(): (a) if the call is within an XPath expression, the *context item type* that applies to the outermost containing XPath expression, determined by the rules in 19.2. (b) if the call is within a pattern, the *match type* of the pattern, as defined in 19.2. [Note: a call to current() in a pattern will always be within a predicate, which means that the match type of the pattern will never depend on the static type of the call to current(), so there is no circularity in this definition]. In 19.8.9.3, Streamability of fn:current(), change the rules to (§§ marks changes): The sweep and posture of a call to the current function are determined as follows: §§1. If the call appears within a pattern [Note: it will always be within a predicate of the pattern], then climbing and motionless. 2. Otherwise, let E be the outermost containing XPath expression of the call to the current function. 2(a) If the context posture of E is grounded, then motionless and grounded. 2(b) If the path in the expression tree that connects the call on current to E (excluding E itself) contains an expression that is a higher-order operand of its parent expression, then climbing and motionless. §§2(c) Otherwise, the posture is the context posture, and the sweep is motionless.
The changes were agreed and have been applied.