Oxygen SaxonPE 188.8.131.52 vs SaxonPE 184.108.40.206J Transform
Using Java -version: openjdk 10.0.2 2018-07-17, OpenJDK Runtime Environment 18.3 (build 10.0.2+13), OpenJDK 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
Using Saxon-PE 220.127.116.11J from Saxonica CMD>java net.sf.saxon.Transform
Produces different output compared to using the same (xsl and data) Transform in Oxygen Editor 22.1 using SaxonPE 18.104.22.168
The Oxygen Transform is producing correct output but I need to run production Transforms via a Windows Batch file, using the java net.sf.saxon.Transform command.
#1 Updated by Michael Kay about 1 year ago
I can't think of any obvious reason why the two environments should produce different results, but we'll certainly be happy to investigate if you can supply a repro (that is, stylesheet, source document, expected results, and any dependencies such as Java extension functions.)
#2 Updated by Raymond Lillibridge about 1 year ago
When the zip file is unzipped, it should create a top-level folder named Municode. In this folder is a PNG snap-shot of the diffing results for the two outputs I am getting when I run from the command line and Oxygen.
If you cd to the Job folder, you will find Sample Outputs, which contains the two different outputs I'm getting.
Running the SaxonDebug.bat from the Job folder will generate a new "bad" example (I'm using SaxonPE22.214.171.124J from the command line.)
#3 Updated by Michael Kay about 1 year ago
I had to move the .txt file to get this to run, and I also needed to make adjustments (on my MAC) to stop the .DSStore files in the input directory being processed.
With those changes I have run the transformation successfully and it produces the output reported.
From the -T trace output, the first
tr element where the attribute differences are reported is generated by the literal result element at line="544" column="7" module="MCC_cals2html.xsl", which generates the style attribute from variable
$rowStyle , which in turn comes from
$rowFontWeightStyle, which takes the value from the data passed in to parameter
$map_setrow_fv. This value is initialized at line 174. Adding an xsl:message, it appears to have the value:
<entry key="1">font-weight:bold;</entry> <entry key="2">font-style:italic;</entry> <entry key="3">font-weight:bold; font-style:italic;</entry> <entry key="4">font-style:normal; font-weight:normal</entry>
The code is selecting one of these entries based on the value of position().
The -T output shows that the template rule with match="row|caprow" is invoked from xsl:apply-templates at line 488, which defaults to
select="node()", and that it is selecting whitespace text nodes as well as
row elements. So the position count includes the whitespace text nodes.
Presumably, because of some configuration settings, Oxygen is running the transformation with whitespace text nodes stripped, although the stylesheet specifies
<xsl:preserve-space elements="*"/>. If I change this to
strip-space, the output is the same as the Oxygen output.
I would recommend two changes (either on its own is sufficient):
Change the stylesheet to use
xsl:apply-templatesinstruction at line 488 to say
select="*"so it only processes child elements, skipping any whitespace text node interspersed between the elements.
Please register to edit this issue