Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-171

XPath position() function returns twice the position

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Incomplete
    • Affects Version/s: 1.3.x
    • Fix Version/s: None
    • Component/s: XPathC
    • Labels:
      None
    • Environment:
      Operating System: Windows NT/2K
      Platform: PC
    • Bugzilla Id:
      11629

      Description

      Given the following input XML :

      <?xml version="1.0"?>
      <list>
      <item/>
      <item/>
      <item/>
      <item/>
      </list>

      and the following XSLT

      <?xml version="1.0"?>

      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="html" />
      <xsl:template match="item">
      Item <xsl:value-of select="position()"/>
      </xsl:template>
      <xsl:template match="/">
      <html>
      <body>
      <xsl:apply-templates />
      </body>
      </html>
      </xsl:template>
      </xsl:stylesheet>

      The output is

      <html>
      <body>

      Item 2

      Item 4

      Item 6

      Item 8
      </body>
      </html>

      It should be 1,2,3,4

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yvesb@users.sourceforge.net Yves Berquin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: