XSLT Debugger Messages View

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

XSLT Debugger Messages View

Post by Fiona Chen »

Hello, I need to debug my XSL program.

When I turn on the Oxygen debugging sessions, the Messages View doesn't display any message. Below is a example.
image.png
image.png (121.92 KiB) Viewed 2890 times
Did I miss anything?
Last edited by Fiona Chen on Fri Jan 15, 2021 10:00 pm, edited 1 time in total.
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: XSLT Debugger Messages View

Post by tavy »

Hello,

From what I tested, with <oXygen/> XML Editor 23.0, build 2020111805, the debugging works fine for me.
What version of Oxygen XML do you use?
Can you send me also the XML document used in the debugging process, or a sample on which you reproduce the problem?
What engine do you use for debugging?

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

Hello, Octavian:

<oXygen/> XML Editor 23.0, build 2020121712

A very simple XSL:

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xs"
    version="2.0">
    
    <xsl:template match="/">
        <xsl:message>Test Message</xsl:message>
    </xsl:template>
</xsl:stylesheet>
A very simple XML:

Code: Select all

<source>
    <chapter>Chapter A</chapter>
    <chapter>Chapter B</chapter>
    <chapter>Chapter C</chapter>
    <chapter>Chapter D</chapter>
</source>
XSLT Debugger Perspective -> Messages -> Blank Screen
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

My goal is to use XSLT3.0

Code: Select all

xsl:assert
|

Code: Select all

xsl:try & catch
:
  • Strictly validate the transformation results: the transformation involves large amount of data movement and complex calculation
  • Should any of the transformed element count or value doesn't match, the module throws the exception and terminates the program immediately. It is similar to the application of Java | C# exception throwing
I can't get the

Code: Select all

assert | try/catch
work in Oxygen. Either case throws blank screen.
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: XSLT Debugger Messages View

Post by tavy »

Hello,

Unfortunately I cannot reproduce the problem. I tested with the same version that you used <oXygen/> XML Editor 23.0, build 2020121712. I used Saxon HE 9.9.1.7 for debugging with the default options, and I get the test message in the Messages view.
What engine do you use for debugging? Maybe you have some options set for the processor. Do you use a Saxon configuration file?

debug.png
debug.png (65.59 KiB) Viewed 2846 times

The "try/catch" works fine in Oxygen from what I tested. For the "xsl:assert" instruction you need to enable the assertions from the Saxon-PE/EE Options. For this you need to use Saxon-PE or EE, and check the Enable assertions ("-ea") from the Advanced Saxon XSLT Transformation Options. If you run the transformation from Debugger, you can change this option from XSLT / XQuery engine advanced options toolbar button:
https://www.oxygenxml.com/doc/versions/ ... olbar.html
If you are using a transformation scenario set the option from the advance options:
https://www.oxygenxml.com/doc/versions/ ... ed-options

You can find more details about Saxon options in our user manual:
https://www.oxygenxml.com/doc/versions/ ... ee_options
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

Hello, Octavian:

I deleted the Oxygen & plugin Options & Project state related files in the FS.
Miraculously, it produced the expected message in the simple template...Eh
image.png
image.png (154.75 KiB) Viewed 2828 times
(Notice: The UI is different from my previous image after the cleanup. )

The processor is ALWAYS the same:
image.png
image.png (79.52 KiB) Viewed 2828 times
However, the system can't emit the message when the template is complex.
Not sure if it is because :
I use ${currentFileURL} as XML URL in the transformation scenario. Notice the debugger perspective doesn't display input XML if you use ${currentFileURL}.

Can you test this:
create a template using source-document, use ${currentFileURL} as XML URL , and then execute it in Debugger perspective.

Code: Select all

<xsl:template match="/">
        <xsl:message>TEST MESSAGE</xsl:message>
        <xsl:source-document href="foo.xml">
             <xsl:apply-templates select="foo-sth" mode="val"/>
        </xsl:source-document>
    </xsl:template>
And please let me know if your Oxygen can emit the message or not?

Thank you!!
Attachments
image.png
image.png (89.23 KiB) Viewed 2828 times
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

My latest discovery is that the presence of the input XML coincides with the presence of the xsl:message:
If I open the input XML on the screen then edit/start a debug session, the system returns the xsl:message.

I will let you know if I encounter issue with xsl:assert and try/catch.

Thank you !!
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: XSLT Debugger Messages View

Post by tavy »

Hello,

From what I tested the message is presented also when the ${currentFileURL} is used as XML URL.
If you create a transformation scenario for an XSL and you use the ${currentFileURL} for both XML URL and XSL URL, the ${currentFileURL} editor variable will be expended to the location of the XSL. Therefore, the XSL will be used also as XML input. Because in your template example you match just the root and display a message, the template message should be presented correctly.
image.png
image.png (68.6 KiB) Viewed 2808 times
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

Interesting Point...

Scenario One:
Saxon EE -> Enable streaming mode -> Debug -> no message
image.png
image.png (210.67 KiB) Viewed 2728 times

Scenario Two:
Saxon EE -> Disable streaming mode -> Debug -> xsl:message
Saxon HE | PE works as well
image.png
image.png (212.73 KiB) Viewed 2728 times
Please let me know if you see different results based on above two scenarios from your end!
Is this Oxygen's incompatibility with Streaming or did I misinterpret the functionality of Oxygen/Saxon?
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: XSLT Debugger Messages View

Post by tavy »

Hello,

Thanks for your feedback.

Yes, it seems that when Saxon is in streaming mode the xsl:message is not presented in the Messages view. The message is presented in the console view, if open you have opened Oxygen from a console you will see the message there.
I added an issue on our issue tracker to investigate this problem. I will update this thread when I have a conclusion.
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Fiona Chen
Posts: 17
Joined: Fri Aug 21, 2020 5:40 pm

Re: XSLT Debugger Messages View

Post by Fiona Chen »

Excellent!

Below should be the aligned output in Oxygen/SaxonEE with Streaming mode.

On-success message:
SaxEE-editor-onsuccessprint-message.jpg
SaxEE-editor-onsuccessprint-message.jpg (54.57 KiB) Viewed 2705 times
On-failure message:
SaxEE-editor-onfailure-message.jpg
SaxEE-editor-onfailure-message.jpg (52.58 KiB) Viewed 2705 times
On-termination exception:
SaxEE-editor-onterminate.jpg
SaxEE-editor-onterminate.jpg (71.4 KiB) Viewed 2705 times
This is the preliminary validation.
Notice that the system is in Editor perspective not Debug. It gives the clarity as if the validation is actually acted out exactly as instructed.

I am reviewing different solutions of comprehensive validation and exception throwing.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: XSLT Debugger Messages View

Post by Radu »

Hi,
As an update this problem should now be fixed in Oxygen 24.1.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply