Project

Profile

Help

Bug #6405 » check-column-number.xsl

Reproduces behavior - A Galtman, 2024-04-28 20:54

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
version="3.0">
<xsl:template name="xsl:initial-template">
<xsl:variable name="xslt-file-content" select="doc('text-inside-when.xsl')"/>

<!-- Comments indicating return values reflect Saxon-EE 12.4J -->

<!-- Single-line text nodes -->
<!-- Column number of "43 to 50" node directly in xsl:when.
Returns 51, which is the position at the beginning of the end tag of the *parent* xslt:when element. Why? -->
<xsl:sequence select="saxon:column-number($xslt-file-content//xsl:when[1]/text())"/>
<!-- Column number of "53 to 60" text node in xsl:when/xsl:text.
Returns 53, which is the correct starting position of the text node. -->
<xsl:sequence select="saxon:column-number($xslt-file-content//xsl:when[3]/xsl:text/text())"/>

<!-- Multiple-line text nodes -->
<!-- Column number of text node directly in xsl:when.
Returns 13, which is the position at the beginning of the start tag of the *parent* xsl:when element. Why? -->
<xsl:sequence select="saxon:column-number($xslt-file-content//xsl:when[2]/text())"/>
<!-- Column number of text node in xsl:when/xsl:text.
Returns 27, which is the correct starting position of the text node. -->
<xsl:sequence select="saxon:column-number($xslt-file-content//xsl:when[4]/xsl:text/text())"/>
</xsl:template>
</xsl:stylesheet>
(1-1/2)