debugger missing empty templates

Are you missing a feature? Request it's implementation here.
xmlhelpline
Posts: 2

debugger missing empty templates

Thu Oct 05, 2017 3:30 pm

Greetings,
our team is working on lots of XSLT templates and using the debugger frequently. We frequently pick up code created by other users.

problem:
In working with the debugger if you encounter a template that does nothing, the debugger will not be able to "step through" it. It simply skips over it (even though it is actually processed).

background:
We have elements that may initially have no target mapping. So an element template for it is initially empty. Later, a mapping is found and we need to change it so that the template provides target output.

Take a template like this:
<xsl:template match="someElement"/>

It provides no target output. It absolutely is fired in the processing.
You can do a full stack trace to find that this template actually fired. However, if you step through the templates in the Oxygen debugger you will never see that this template was actually fired. It simply skips over it and moves on to the next template. Even if you set break points and "step" one step at a time.

So we are having to do a maddening analysis of "which of hundreds of templates is empty and needs to be changed with target output". And oxygen is no help.

submitted respectfully. We love the debugger.
gravyboat
Posts: 7

Re: debugger missing empty templates

Thu Oct 05, 2017 4:31 pm

This has been a source of frustration for me as well; I've worked around it by adding content to the template, i.e.,

<xsl:template match="someElement">
<xsl:comment>empty template</xsl:comment>
</xsl:template>

In order to step through in debugger, but it would be nice if it could stop on empty templates.
adrian
Posts: 2326

Re: debugger missing empty templates

Thu Oct 05, 2017 5:05 pm

Hello,

Thank you for the feedback.

I've submitted an issue to investigate if this can be improved. Note that this may very well depend on the capabilities of the transformer engine (Saxon/Xalan, etc).
From what I tested, when debugging with Xalan (XSLT 1.0), Step Into also stops in empty templates. However, Saxon doesn't seem to do the same.

BTW, a simpler workaround for this that does not affect the content is to use xsl:message.
e.g.

Code: Select all

<xsl:template match="someElement">
<xsl:message>msg</xsl:message>
</xsl:template>

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
xmlhelpline
Posts: 2

Re: debugger missing empty templates

Thu Oct 05, 2017 9:08 pm

thank you for your prompt reply. we are using saxon.
unfortunately we cannot use that workaround as we can't have tons of xsl:messages occur in production code that has no value. some templates remain empty for good reason. others get reworked as new data comes in.

if this is a saxon thing, please let me know and let's see if we can propose any adjustments.
adrian
Posts: 2326

Re: debugger missing empty templates

Fri Oct 06, 2017 4:19 pm

Hi,

From what our developers investigated, it seems to be a Saxon API issue (or limitation?) as Saxon does not notify the trace listener of the empty templates. This issue has been reported to Saxonica:
Somehow notify TraceListener that an empty xsl:template is being matched

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 1 guest