[XML-SIG] [Bug #123854] [4Suite 0.9.1] ancestor axis not in reverse document order

noreply@sourceforge.net noreply@sourceforge.net
Wed, 29 Nov 2000 13:34:28 -0800


Bug #123854, was updated on 2000-Nov-29 13:34
Here is a current snapshot of the bug.

Project: Python/XML
Category: 4Suite
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: [4Suite 0.9.1] ancestor axis not in reverse document order

Details: Using the 4XSLT processor (4Suite 0.9.1 for Windows) on this XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<heading>
  <level>1</level>
  <heading>
    <level>2</level>
    <heading>
      <level>3</level>
      <heading>
        <level>4</level>
        <heading>
          <level>5</level>
        </heading>
      </heading>
    </heading>
  </heading>
</heading>

with this style sheet:

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0"
>

  <xsl:template match="/">
    <xsl:for-each select="//heading">
      <xsl:value-of select="concat('&#xA;current level: ', level, '   parent level: ', ancestor::heading[1]/level)"/>
      </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

yields:


current level: 1   parent level: 
current level: 2   parent level: 1
current level: 3   parent level: 1
current level: 4   parent level: 1
current level: 5   parent level: 1

The "ancestor" axis should select the "heading" elements in reverse document order so the first one in the list is always the most immediate ancestor (in this case, the parent of the context node).  The Xalan, XT, and Saxon processors all do this, so that the result is

<?xml version="1.0" encoding="utf-8" ?>
current level: 1   parent level: 
current level: 2   parent level: 1
current level: 3   parent level: 2
current level: 4   parent level: 3
current level: 5   parent level: 4

(mod white space).

(Note that the "preceding" axis does seem to work properly.) 

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123854&group_id=6473