Project

Profile

Help

Bug #3029

closed

Missing some xsl:when and xsl:choose instructions in trace

Added by Ben Guillon over 7 years ago. Updated almost 7 years ago.

Status:
Won't fix
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2016-11-13
Due date:
% Done:

0%

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

Description

The data the reproduce the case are in bug #3027.

In the case provided, the xsl:when and xsl:otherwise instructions are not listed on the trace file. The test case covers all the conditional branches, so that they should be tracked. Or is it an optimization side-effect? I've the same result with -opt:0.

I haven't this behaviour with saxon 6.5.5.

Actions #1

Updated by Michael Kay over 7 years ago

  • Category set to Diagnostics
  • Status changed from New to Won't fix
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added

The code is working as designed.

We try to avoid having two trace points for the same (internal) expression. Since the source XSLT

      <xsl:variable name="shorturl" select="substring-after($url, 'http:/')"/>
      <xsl:variable name="protocol" select="'HTTP'"/>
      <external where="{$shorturl}" protocol="{$protocol}"/>

compiles to a single internal expression (a LetExpression, which is subsequently optimized by variable inlining - but the optimization isn't relevant here) it is already traced and so we avoid wrapping another trace instruction around it to represent the xsl:when. Perhaps not perfect, but I think it works, and I'm reluctant to add extra trace points which could upset the people who implement interactive debuggers based on the existing logic.

Actions #2

Updated by Ben Guillon over 7 years ago

Ok, thanks for the feedback.

Since I'm trying to update my little package:

https://github.com/marsgui/xslcoverage

The logic to monitor such line coverage is: "if something into the block is covered, then the wrapping conditional block is covered".

To avoid changing something for people already using the trace classes, you could add a new enter/leave function pair like saxon-ce does with enterChooseItem/leaveChooseItem :

https://github.com/Saxonica/Saxon-CE/blob/master/src/client/net/sf/saxon/ce/trace/AbstractTraceListener.java

But i guess it is more complicated or there are side-effects. Thanks for having fixed the other bugs.

Actions #3

Updated by O'Neil Delpratt almost 7 years ago

  • Applies to branch deleted (9.8)
  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF