Project

Profile

Help

Bug #4640

closed

Reference to a variable as an XPath step

Added by Ken Holman almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2020-07-11
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 9.9, trunk
Fix Committed on Branch:
10, 9.9, trunk
Fixed in Maintenance Release:
Platforms:

Description

In Saxon9HE 9.8.0.15 this expression works fine using the first XPath step as an "if" statement:

  <xsl:copy-of
      select="self::table-wrap[ancestor::fig]/$c:f/c:figTableCaptionFonts/@*"/>

In Saxon9HE 9.9.1.7 the expression adds nothing to the result tree.

The $c:f is a tunnel parameter that is initialized with a global variable that is a massage of another global variable:

<xsl:variable name="c:CENcoverFormatting" as="document-node()">
  <xsl:document>
    <xsl:for-each select="($c:mainFormattingDef)/*">
      <xsl:copy>
        <xsl:attribute name="{name(.)}"/>
        <xsl:copy-of select="@*"/>
      </xsl:copy>
    </xsl:for-each>
  </xsl:document>
</xsl:variable>

...

  <xsl:next-match>
    <xsl:with-param name="c:f" tunnel="yes" select="$c:CENcoverFormatting"/>
  </xsl:next-match>

...

<block x:h="div*{name(.)}-caption" x:ignoreXHTML=""
       text-align="center">
  <xsl:copy-of
select="self::table-wrap[ancestor::fig]/$c:f/c:figTableCaptionFonts/@*"/>

Unfortunately, when I isolate the expression in a sample XSLT file, the expression works in both versions of Saxon. There is a 21-stylesheet-fragment tree acting on an XML file of 4300 lines where the problem came to light in the 17000 lines of output. I'm reluctant to package this all up in a submission.

Using 9.8.0.15 the output does have x:figTableCaptionFonts="" and font-size="9pt":

Using 9.9.1.7 the output doesn't have x:figTableCaptionFonts="" and font-size="9pt":

I'm guessing this is an optimization thingy, but I am but a user.

What would you have me put into my example to try and recreate the issue?

Thanks for your guidance!

. . . . . . Ken

Please register to edit this issue

Also available in: Atom PDF