Project

Profile

Help

Bug #6457

open

Trace on xsl:param identifies descendant element, sometimes with column="0" (Saxon-HE 12.4J)

Added by A Galtman 22 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2024-06-24
Due date:
% Done:

0%

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

Description

Trace data about xsl:param for template parameters identifies a descendant element rather than xsl:param itself. Sometimes, the column number is reported as 0, too. If this is correct behavior, can you explain the logic?

Reproduction Steps

The following stylesheet includes a big comment near the bottom that indicates the Saxon command I'm running and the output I'm seeing.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xsl:template name="xsl:initial-template">
    <xsl:param name="p-seq">
      <xsl:sequence select="'p2'"/> <!-- param trace appears here -->
    </xsl:param>
    <xsl:param name="p-seq-value-of">
      <xsl:sequence>
        <xsl:value-of select="'p3'"/> <!-- param trace appears here -->
      </xsl:sequence>
    </xsl:param>
    <xsl:param name="p-value-of">
      <xsl:value-of> <!-- param trace appears here -->
        <xsl:text>p4</xsl:text>
      </xsl:value-of>
    </xsl:param>
    <xsl:param name="p-map" as="map(xs:string, xs:integer)">
      <xsl:map>
        <xsl:map-entry key="'One'" select="100"/> <!-- param trace appears here -->
      </xsl:map>
    </xsl:param>
    <xsl:param name="p-map-entry" as="map(xs:string, xs:integer)">
      <xsl:map-entry key="'One'" select="100"/> <!-- param trace appears here -->
    </xsl:param>
    <xsl:param name="p-if-map-entry" as="map(xs:string, xs:integer)">
      <xsl:if test="$p-map-entry('One') gt 0"> <!-- param trace appears here -->
        <xsl:map-entry key="'One'" select="100"/>
      </xsl:if>
    </xsl:param>
    <xsl:param name="p-choose-map-entry" as="map(xs:string, xs:integer)">
      <xsl:choose>
        <xsl:when test="$p-map-entry('One') gt 0"> <!-- param trace appears here -->
          <xsl:map-entry key="'One'" select="100"/>
        </xsl:when>
      </xsl:choose>
    </xsl:param>
    <xsl:param name="p-seq-map-entry" as="map(xs:string, xs:integer)">
      <xsl:sequence>
        <xsl:map-entry key="'One'" select="100"/> <!-- param trace appears here -->
      </xsl:sequence>
    </xsl:param>
    <xsl:param name="p-no-elements"><!-- param trace at end of xsl:param start tag (correct)
      -->p-no-elements
    </xsl:param>
    <xsl:param name="p-comment-element"><!-- param trace at end of <foo>
      --><foo>100</foo>
    </xsl:param>
    <xsl:param name="p-text-comment-element">foo<!-- param trace between end of xsl:param start tag and start of text node
      --><foo>100</foo>
    </xsl:param>
  </xsl:template>
  
  <!-- Repro steps with Saxon-HE 12.4J:
    
    java -cp "%SAXON_CP%" net.sf.saxon.Transform -T -xsl:trace-xsl-param.xsl -it -opt:0 >output.txt
    
    Resulting trace:

    <trace saxon-version="12.4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template name="xsl:initial-template" line="5" column="45" module="trace-xsl-param.xsl">
      <param line="7" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="11" column="38" module="trace-xsl-param.xsl">
      </param>
      <param line="15" column="21" module="trace-xsl-param.xsl">
      </param>
      <param line="21" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="25" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="28" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="34" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="41" column="0" module="trace-xsl-param.xsl">
      </param>
      <param line="44" column="37" module="trace-xsl-param.xsl">
      </param>
      <param line="48" column="15" module="trace-xsl-param.xsl">
      </param>
      <param line="50" column="46" module="trace-xsl-param.xsl">
      </param>
     </xsl:template>
    </trace>
  -->

</xsl:stylesheet>

No data to display

Please register to edit this issue

Also available in: Atom PDF