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

XPath position and last functions

    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: Linux
      Platform: PC
    • Bugzilla Id:
      8322

      Description

      The position and last function don't return the right information for the child
      of the root node. I test with this xml

      <?xml version="1.0"?>
      <root>
      <nodo name="A">
      <descr>A</desc>
      </nodo>
      <nodo name="B">
      <descr>B</descr>
      <nodo name="C">
      <descr>C</descr>
      </nodo>
      </root>

      The xsl file I use is:

      <?xml version="1.0"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:template match="root">
      <html>
      <body>
      <xsl:apply-templates/>
      </body>
      </html>

      <xsl:template match="nodo">
      <b><xsl:value-of select="position()"/>--<xsl:value-of select="last()"/>--
      <xsl:value-of select="./descr"/></b><br/>
      <xsl:apply-templates select="./nodo"/>
      </xsl:template>
      </xsl:stylesheet>

      When you run the XalanTransform with this files as input and you see the html
      output you will see that:

      1. the last node is indicated as node 7
      2. the three nodes have position 2/4/6

      The right results should be:

      1. last node 3
      2. the three nodes with position 1/2/3

      For all other level of child nodes this two functions work well.
      I'm trying to write a patch but unfortunatelly I'm very busy with my job. It's
      sure that if I write a patch i'll send to you.

      Thanks in advance
      Christian Fontana

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fontana@netw.it Christian Fontana
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: