Project

Profile

Help

Bug #6498

open

SaxonJ-HE 12.5 Normal Level of Trace output when using fn:transform() with -Tlevel:high

Added by Adrian Bird 5 months ago.

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

0%

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

Description

When using -Tlevel:high with a stylesheet that uses fn:transform() to call a function I don't get the same trace produced as when calling the function directly.

The attached files are:

  • FunctionCompare.xslt - contains a function called my:compare with 2 parameters. The function includes a xsl:choose so that it generates reasonable trace output.
  • CallFunctionViaTransform.xslt - calls the my:compare function via fn:transform() with values 'a' and 'b'.
  • CallFunctionDirectly.xslt - imports FunctionCompare.xslt and calls the my:compare function directly with values 'a' and 'b'.

Concentrating on just the trace output for module FunctionCompare.xslt, I get the same trace when -Tlevel is low or normal calling it both ways.

However when -Tlevel is high I get a lot more trace from the CallFunctionDirectly.xslt stylesheet compared to the CallFunctionViaTransform.xslt stylesheet for the FunctionCompare.xslt module. The trace from the CallFunctionViaTransform.xslt stylesheet looks the same as the trace output when -Tlevel:normal is used.

The trace produced with -Tlevel:high is below.

CallFunctionViaTransform.xslt Trace

<trace saxon-version="12.5" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template name="xsl:initial-template" line="14" column="45" module="CallFunctionViaTransform.xslt">
  <lookupExp expr='fn:transform(...) ? "output"' line="15" column="62" module="CallFunctionViaTransform.xslt">
   <call expr="fn:transform(...)" line="15" column="62" module="CallFunctionViaTransform.xslt">
    <gVarRef expr="$transformMap" line="15" column="62" module="CallFunctionViaTransform.xslt">
     <xsl:variable name="transformMap" line="6" column="65" module="CallFunctionViaTransform.xslt">
      <call expr="map:merge(...)" line="8" column="87" module="CallFunctionViaTransform.xslt">
       <sequence expr="(map:entry(...), ...)" line="8" column="87" module="CallFunctionViaTransform.xslt">
       </sequence>
       <literal expr='map{QName("http://saxon.sf.net/", "duplicates-error-code"):"XTDE3365","duplicates":"reject"}' line="8" column="87" module="CallFunctionViaTransform.xslt">
       </literal>
       <call expr="map:entry(...)" line="8" column="87" module="CallFunctionViaTransform.xslt">
        <literal expr='"initial-function"' line="8" column="87" module="CallFunctionViaTransform.xslt">
        </literal>
        <call expr="fn:QName(...)" line="8" column="87" module="CallFunctionViaTransform.xslt">
         <literal expr='"my-ns"' line="8" column="87" module="CallFunctionViaTransform.xslt">
         </literal>
         <literal expr='"my:compare"' line="8" column="87" module="CallFunctionViaTransform.xslt">
         </literal>
        </call>
       </call>
       <call expr="map:entry(...)" line="9" column="84" module="CallFunctionViaTransform.xslt">
        <literal expr='"stylesheet-location"' line="9" column="84" module="CallFunctionViaTransform.xslt">
        </literal>
        <literal expr='"FunctionCompare.xslt"' line="9" column="84" module="CallFunctionViaTransform.xslt">
        </literal>
       </call>
       <call expr="map:entry(...)" line="10" column="74" module="CallFunctionViaTransform.xslt">
        <literal expr='"function-params"' line="10" column="74" module="CallFunctionViaTransform.xslt">
        </literal>
        <call expr="array:_from-sequence(...)" line="10" column="74" module="CallFunctionViaTransform.xslt">
         <literal expr='("a", "b")' line="10" column="74" module="CallFunctionViaTransform.xslt">
         </literal>
        </call>
       </call>
      </call>
     </xsl:variable>
    </gVarRef>
    <xsl:function arity="2" name="my:compare" line="6" column="55" module="FunctionCompare.xslt">
     <choose line="9" column="17" module="FunctionCompare.xslt">
      <xsl:text text="param1 less than param2" line="17" column="19" module="FunctionCompare.xslt">
      </xsl:text>
     </choose>
    </xsl:function>
   </call>
   <literal expr='"output"' line="15" column="62" module="CallFunctionViaTransform.xslt">
   </literal>
  </lookupExp>
 </xsl:template>
</trace>

CallFunctionDirectly.xslt Trace

<trace saxon-version="12.5" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template name="xsl:initial-template" line="8" column="45" module="CallFunctionDirectly.xslt">
  <userFunctionCall expr="my:compare(...)" line="9" column="50" module="CallFunctionDirectly.xslt">
   <xsl:function arity="2" name="my:compare" line="6" column="55" module="FunctionCompare.xslt">
    <choose line="9" column="17" module="FunctionCompare.xslt">
     <ValueComparison expr="$param1 eq $param2" line="10" column="43" module="FunctionCompare.xslt">
      <atomizeSingleton expr="$param1" line="10" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param1" line="10" column="43" module="FunctionCompare.xslt">
        <literal expr='"a"' line="9" column="50" module="CallFunctionDirectly.xslt">
        </literal>
       </locVarRef>
      </atomizeSingleton>
      <atomizeSingleton expr="$param2" line="10" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param2" line="10" column="43" module="FunctionCompare.xslt">
        <literal expr='"b"' line="9" column="50" module="CallFunctionDirectly.xslt">
        </literal>
       </locVarRef>
      </atomizeSingleton>
     </ValueComparison>
     <ValueComparison expr="$param1 gt $param2" line="13" column="43" module="FunctionCompare.xslt">
      <atomizeSingleton expr="$param1" line="13" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param1" line="13" column="43" module="FunctionCompare.xslt">
       </locVarRef>
      </atomizeSingleton>
      <atomizeSingleton expr="$param2" line="13" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param2" line="13" column="43" module="FunctionCompare.xslt">
       </locVarRef>
      </atomizeSingleton>
     </ValueComparison>
     <ValueComparison expr="$param1 lt $param2" line="16" column="43" module="FunctionCompare.xslt">
      <atomizeSingleton expr="$param1" line="16" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param1" line="16" column="43" module="FunctionCompare.xslt">
       </locVarRef>
      </atomizeSingleton>
      <atomizeSingleton expr="$param2" line="16" column="43" module="FunctionCompare.xslt">
       <locVarRef expr="$param2" line="16" column="43" module="FunctionCompare.xslt">
       </locVarRef>
      </atomizeSingleton>
     </ValueComparison>
     <xsl:value-of line="17" column="19" module="FunctionCompare.xslt">
      <literal expr='"param1 less than param2"' line="17" column="19" module="FunctionCompare.xslt">
      </literal>
     </xsl:value-of>
    </choose>
   </xsl:function>
  </userFunctionCall>
 </xsl:template>
</trace>

I would expect the same trace output in both cases when -Tlevel:high is used.

Adrian


Files

CallFunctionDirectly.xslt (405 Bytes) CallFunctionDirectly.xslt Adrian Bird, 2024-08-08 12:50
CallFunctionViaTransform.xslt (735 Bytes) CallFunctionViaTransform.xslt Adrian Bird, 2024-08-08 12:50
FunctionCompare.xslt (727 Bytes) FunctionCompare.xslt Adrian Bird, 2024-08-08 12:50

No data to display

Please register to edit this issue

Also available in: Atom PDF