Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2457

xsl:number fails when count item is doubly nested and end tag is on same line

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.1
    • None
    • Xalan
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • None
    • WinXP, java 1.6.0_07 testing with xalanj in custom java as well as in Oxygen 9 XSLT Debugger

    Description

      test case:

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:template match="top">
      <xsl:apply-templates/>
      </xsl:template>
      <xsl:template match="middle">
      <xsl:number format="1" from="top" level="any" count="bottom"/>
      </xsl:template>
      </xsl:stylesheet>

      <?xml version="1.0" encoding="UTF-8"?>
      <top>
      <middle>
      <test><bottom/><bottom/></test>
      </middle>
      <middle/>
      </top>

      The output is correctly

      0
      2

      However, if the xml is changed so that the first /middle tag is at the end of the line rather than on a new line of it's own

      <top>
      <middle>
      <test><bottom/><bottom/></test></middle>
      <middle/>
      </top>

      The output becomes
      0
      0

      It appears that it does not count the two bottom tags if the /middle tag is on the end of the line. I tried this with multiple other sets of markup and the results are the same.

      Attachments

        1. test.xml
          0.1 kB
          Jeffrey Barrus
        2. test.xsl
          0.3 kB
          Jeffrey Barrus

        Issue Links

          Activity

            People

              Unassigned Unassigned
              barrusj Jeffrey Barrus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: