Project

Profile

Help

Support #6280

closed

xsl:apply-templates without select attribute not working properly in xsl:template with multiple modes

Added by Johan Gheys 12 months ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2023-12-04
Due date:
% Done:

0%

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

Description

When testing Saxon-EE 12.4, we got the following error message during one of our transformations (see attachment):

2023-12-04 22:12:49 [INFO] Batch execution starting...
2023-12-04 22:12:49 [DEBUG] Deleting C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/output/
2023-12-04 22:12:49 [DEBUG] Sleeping for 1 seconds...
2023-12-04 22:12:50 [DEBUG] Execution time: 1.026s
2023-12-04 22:12:50 [DEBUG] Creating C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/output/
2023-12-04 22:12:50 [DEBUG] Execution time: 0.005s
2023-12-04 22:12:50 [INFO] Transforming file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/input/graphicalEdge.xml
2023-12-04 22:12:50 [INFO] 	into file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/output/graphicalEdge.xml
2023-12-04 22:12:50 [INFO] 	using downgrade.xslt
2023-12-04 22:12:50 [INFO] 	parameter macro-target-schema-version=4
2023-12-04 22:12:50 [DEBUG] Exporting file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/output/graphicalEdge.xml
2023-12-04 22:12:50 [DEBUG] Execution time: 0.23s
2023-12-04 22:12:50 [INFO] Transforming file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/input/trackEdge.xml
2023-12-04 22:12:50 [INFO] 	into file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/output/trackEdge.xml
2023-12-04 22:12:50 [INFO] 	using downgrade.xslt
2023-12-04 22:12:50 [INFO] 	parameter macro-target-schema-version=4
Type error at xsl:apply-templates on line 228 column 51 of downgrade.xslt:
  XTTE0570  The required item type of the value of variable $updated-element is element();
  the supplied value text{} does not match. The supplied value is a text node
  In template rule with match="element(Q{http://www.infrabel.be/int/macro}trackEdges)" on line 223 of downgrade.xslt
     Focus
        Context item: /macro:trackEdges
        Context position: 1
     Local variables
        (All variables are null)
     invoked by xsl:apply-templates (tail calls omitted) at file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/xslt/downgrade.xslt#21
2023-12-04 22:12:50 [ERROR] description: The required item type of the value of variable $updated-element is element(); the supplied value text{} does not match. The supplied value is a text node
2023-12-04 22:12:50 [ERROR] module: file:/C:/Data/MyProjects/int-batch/src/test/resources/saxon/apply-templates-xxxx/xslt/downgrade.xslt
2023-12-04 22:12:50 [ERROR] line-number: 228
2023-12-04 22:12:50 [ERROR] Batch execution failed - see above output for any hints
Error in xsl:sequence/@select on line 26 column 45 of batch.xslt:
  FOER0000  Error signalled by application call on error()
In template xsl:initial-template on line 12 column 56 of batch.xslt:
     Focus: absent
     Local variables
        $vv:v0 {fn:current-date() lt xs:date("2000-01-01")} = false()
        $startTime = xs:dateTimeStamp("2023-12-04T22:12:49.135+01:00")
In template xsl:initial-template on line 12 column 56 of batch.xslt:
     Focus: absent
     Local variables
        $vv:v0 {fn:current-date() lt xs:date("2000-01-01")} = false()
        $startTime = xs:dateTimeStamp("2023-12-04T22:12:49.135+01:00")
Error signalled by application call on error()

The transformation succeeds for macro:graphicalEdges. This element matches 2 templates each having a single mode. The transformation fails for macro:trackEdges. This element matches 1 template with 2 modes. In any case, the error message is somewhat misleading. Note that the problem was already present in 12.3 and that the problem is fixed when line 228 of downgrade.xslt is changed to

<xsl:apply-templates select="*" mode="#current"/>

Files

apply-templates.zip (10.6 KB) apply-templates.zip Johan Gheys, 2023-12-04 22:39

Please register to edit this issue

Also available in: Atom PDF