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:strip-space elements="*"
-
Change the xsl:apply-templates
instruction at line 488 to say select="*"
so it only processes child elements, skipping any whitespace text node interspersed between the elements.