debugger missing empty templates

Are you missing a feature? Request its implementation here.
xmlhelpline
Posts: 2
Joined: Wed Sep 23, 2009 3:19 pm

debugger missing empty templates

Post by xmlhelpline »

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
Joined: Fri Sep 16, 2011 10:30 pm

Re: debugger missing empty templates

Post by gravyboat »

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: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: debugger missing empty templates

Post by adrian »

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
Joined: Wed Sep 23, 2009 3:19 pm

Re: debugger missing empty templates

Post by xmlhelpline »

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: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: debugger missing empty templates

Post by adrian »

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
teo
Posts: 57
Joined: Wed Aug 30, 2017 3:56 pm

Re: debugger missing empty templates

Post by teo »

Hello!

We released oXygen XML Editor version 20 and the problem reported here was fixed, by integration of the latest Saxon version.
So, the empty templates are no longer skipped when using "Step into" or breakpoints for debugging.

You can download the build from here:
https://www.oxygenxml.com/xml_editor/do ... ditor.html

Regards,
Teo
Teodor Timplaru
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply