xspec: Coverage XML file is not well-formed (ends mid-element)

With Saxon EE 12.5 running on the command line and today’s XSpec (2025-02-10; XSpec apparently does not report its version, but the pom says “3.2-SNAPSHOT”) I processed two XSpec files with coverage (-c). One completed successful and generated a coverage report with no highlighting; I don’t know whether I should have expected highlighting.

I’m opening an issue because the other one aborted the output coverage XML file mid-line (line 732):

<hit lin

The XSpec tests all complete successfully; the error appears only with the coverage report. I’d be happy to provide copies of the files, which are not large, if that would be helpful, but I didn’t want to clutter this report if it involves a known issue.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve had a quick look and it seems that the issue has been fixed for XSpec, but I want to do some more investigation. I intend to create a Saxon 12.6 issue here to document my findings for the issue and other things related to Code Coverage.

The problem with the previous attempt was that if ‘transform’ called a ‘template’ which called a ‘function’ then I reduced the open() count, and shouldn’t have.

The updated logic for the fix would be (2nd line is new):

When ‘<call expr=“fn:transform(…)”’ happens, set a flag to indicate a possible issue. When ‘<xsl:template’ happens unset the flag, as this doesn’t lead to the issue . When ‘<xsl:function’ happens, update the flag if it is set, to indicate an actual issue. When ‘</call’ happens, if flag is updated then reduce the open() count. Reset the flag in all cases.

I’ve done an update to the Trace Listener.

XSLTCoverageTraceListener.java.txt

I see that Saxonica have fixed and closed the issue raised on them, and are also saying that Saxon 12.6 is due for release soon.