Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Sunday, November 10, 2024 from 20:00 UTC until 21:00 UTC to perform important network maintenance in our primary data center. Your Planio account will be unavailable for a few minutes during this maintenance window.

Tracing change since Saxon 10 ?

Added by Christophe Marchand over 1 year ago

Hello,

I use XSpec with code coverage. With Saxon 9.9.1.8, I get some tracing infos, but when I switch to Saxon 10 or more recent, I do not have any tracing informations.

Does something changed between Saxon 9 and 10 on this ?

Just to help me to find where I have to look to correct XSpec bug...

Christophe


Replies (7)

Please register to reply

RE: Tracing change since Saxon 10 ? - Added by Michael Kay over 1 year ago

Yes, it's entirely possible that there have been minor changes in this area. We would need to see exactly what you are doing to be more precise.

RE: Tracing change since Saxon 10 ? - Added by Christophe Marchand over 1 year ago

Ok, I'm gonna try to extract all code...

java -cp "saxon-ee-10.9.jar" net.sf.saxon.Transform -T:com.jenitennison.xslt.tests.XSLTCoverageTraceListener -o:... -xsl:... -it:"{http://www.jenitennison.com/xslt/xspec}main" and many other system properties used by XSLTCoverageTraceListener

Java code is available here : https://github.com/xspec/xspec/blob/master/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.java You should know this code, your are listed in contributors list

I can provide my whole code if required.

Best regards, Christophe

RE: Tracing change since Saxon 10 ? - Added by Michael Kay over 1 year ago

Sorry to disappoint you, but I don't know the code! I expect they acknowledged me because they started by hacking an example I had written to do something quite different.

I'll take a look though.

RE: Tracing change since Saxon 10 ? - Added by Christophe Marchand over 1 year ago

Thanks a lot, Michael ! Jeni or Florent did some hacking ? Strange ;-)

It seems the XSLTCoverageTraceListener is call, at least the open method at line # 72 because the root element is written.

Best regards, Christophe

RE: Tracing change since Saxon 10 ? - Added by Michael Kay over 1 year ago

Changes were made to tidy up the tracing information in Saxon 10: see https://www.saxonica.com/documentation12/index.html#!changes/spi/9.9-10 and search for "Tracing".

I'm a little surprised that it runs at all, rather than throwing some kind of Java error; the trace listener code supplied won't compile against Saxon 10.

There is no longer a trace call at the level that used to be LocationKind.XPATH_IN_XSLT. I imagine that change was made to avoid multiple calls at the same point, but I can see that it might be useful for a TraceListener to know that we're at the XSLT-XPath boundary.

Attached is a rewrite of the trace listener that compiles successfully; I don't know if it works as a plug-in replacement because I'm not sure how the data that's collected is subsequently processed.

XSLTCoverageTraceListener.java (14.3 KB) XSLTCoverageTraceListener.java Rewrite of supplied trace listener

RE: Tracing change since Saxon 10 ? - Added by Christophe Marchand over 1 year ago

Thanks a lot, Mike, for this !

It seems to work. I'm just surprised by the coverage result, xsl:sequence are all non-evaluated.

I'm gonna spend more time on this later, I teach today !

Attached a coverage report. You'll see very strange coloring...

Thanks again, Christophe

RE: Tracing change since Saxon 10 ? - Added by Michael Kay over 1 year ago

Is there any function inlining going on? It's worth checking what happens if you suppress all optimisations using -opt:0.

    (1-7/7)

    Please register to reply