Bug #5553
closedSaxonCS - when running from command line, xsl:message output goes nowhere
Added by Michael Kay over 2 years ago. Updated almost 2 years ago.
100%
Description
See https://saxonica.plan.io/boards/3/topics/8755?pn=1
xsl:message output from a command line transformation in SaxonCS simply disappears.
Related issues
Updated by Michael Kay over 2 years ago
The problem seem to be with class LoggingWriter, which attempt to bridge the "Writer" interface to the Saxon Logger.
The LoggingWriter is Java code that overrides java.io.Writer. The transpiler simply converts this to a corresponding C# class that overrides System.IO.TextWriter
. The problem is, although the Java and C# interfaces are very similar (otherwise this wouldn't be possible), the methods that a subclass has to implement appear to be different in the two cases. It looks like the output is being written to an interface that we haven't implemented, causing it to disappear.
Updated by Michael Kay over 2 years ago
Specifically, The C# TextWriter says:
A derived class must minimally implement the Write(Char)
method to make a useful instance of TextWriter.
while Java Writer says
The only methods that a subclass must implement are write(char[], int, int)
, flush()
, and close()
Updated by Michael Kay over 2 years ago
- Status changed from New to In Progress
Fixed by re-implementing the LoggingWriter class in hand-coded C# as Saxon.Impl.Overrides.LoggingWriter
.
Updated by Michael Kay over 2 years ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch 11, trunk added
Updated by Debbie Lockett over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.4 added
Bug fix applied in the Saxon 11.4 maintenance release.
Updated by Martin Honnen over 2 years ago
For me, at least on Windows, I don't see any fix:
SaxonCS:
PS C:\Users\marti\SomePath\saxoncs-message-test> & 'C:\Program Files\Saxonica\SaxonCS-11.4\SaxonCS.exe' transform -it -xsl:.\sheet1.xsl
<?xml version="1.0" encoding="UTF-8"?><test>Run with SAXON EE 11.4 </test><!--Run with SAXON EE 11.4 -->
Saxon HE Java:
PS C:\Users\marti\SomePath\saxoncs-message-test> java -jar 'C:\Program Files\Saxonica\SaxonHE11-4J\saxon-he-11.4.jar' -it -xsl:.\sheet1.xsl
Run with SAXON HE 11.4
<?xml version="1.0" encoding="UTF-8"?><test>Run with SAXON HE 11.4 </test><!--Run with SAXON HE 11.4 -->
Code
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">
<xsl:template match="/" name="xsl:initial-template">
<test>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</test>
<xsl:comment>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
<xsl:message>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:message>
</xsl:template>
</xsl:stylesheet>
Updated by Michael Kay over 2 years ago
- Status changed from Closed to In Progress
It seems that as a result of some kind of build error the corrected LoggingWriter
is not being used, and the old one (transpiled from the Java version) is still invoked.
Updated by Michael Kay over 2 years ago
- Status changed from In Progress to Resolved
I suspect I made changes locally to the C# code to test the fix, and then failed to apply the corresponding fix to the Java source to make it persist.
Updated by Michael Kay about 2 years ago
- Has duplicate Bug #5648: SaxonCS with command line -ea:on triggers xs:assert but doesn't output the message inside added
Updated by O'Neil Delpratt almost 2 years ago
- Fixed in Maintenance Release 12.0 added
- Fixed in Maintenance Release deleted (
11.4)
Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied to Saxon 11 branch.
Updated by O'Neil Delpratt almost 2 years ago
- Fixed in Maintenance Release 11.5 added
Bug applied in the Saxon 11.5 Maintenance release.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
Please register to edit this issue