Project

Profile

Help

Bug #6654

closed

XTDE1360 Dynamic evaluation of the current() function is not supported

Added by Michael Kay 12 days ago. Updated 11 days ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Features new in 4.0
Sprint/Milestone:
-
Start date:
2025-01-17
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

I get this error (on both 12.x and 13.x) with a 4.0 stylesheet that makes a static call on current(). See attached


Files

test.xsl (3.37 KB) test.xsl Michael Kay, 2025-01-17 17:25
test.xml (270 Bytes) test.xml Michael Kay, 2025-01-17 17:25
Actions #1

Updated by Michael Kay 12 days ago

The optimizer trace shows

OPT : At line 22 of file:/Users/mike/Desktop/temp/test.xsl
OPT : Extracted global variable vv:gg1636506029 := data((((current()) treat as node())/child::element(Q{http://www.w3.org/1999/XSL/Transform}field))/attribute::attribute(Q{}name))

It seems to have failed to recognize that an expression calling current() can't be promoted to global.

The error message arises when current() is called as a normal function - it should be rewritten as a variable reference. It's misleading because this isn't a dynamic function call, just a static function call happening at runtime.

Actions #2

Updated by Michael Kay 11 days ago

The problem is that XSLIf doesn't call typeCheck() on the then and else subexpressions (new 4.0 feature), and it's during the typeCheck call that calls on current() are resolved.

Actions #3

Updated by Michael Kay 11 days ago

  • Category set to Features new in 4.0
  • Status changed from New to Resolved
  • Fix Committed on Branch 12, trunk added
  • Platforms .NET added

Please register to edit this issue

Also available in: Atom PDF