Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6548592

Wrong behaviour of the "xsl:number" element

    Details

    • Subcomponent:
    • Introduced In Build:
      1.4
    • Introduced In Version:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        Products: JDK 6, JAXP RI 1.4.

        The following XSLT code fragment:
                <xsl:template match="title">
                    <xsl:number level="single" from="a" count="a|b|c|d|e" format="1" />
        is applied to the following input:
                 <a>
                    <title>Level A</title>
        For this <title> and the xsl:number element RI's transformer produces "1". But it should produce empty string "".
        The XSLT 1.0 specification (http://www.w3.org/TR/xslt#number) says:
        "If the from attribute is specified, then the only ancestors that are searched are those that are descendants of the nearest ancestor that matches the from pattern."
        According to the specification, the XSLT element
        <xsl:number level="single" from="a" count="a|b|c|d|e" format="1"/>
        should return an empty string since there are no "a|b|c|d|e" elements which are descendants of the <a> element
        (which is the first element on ancestor-or-self axis which matches expression in "from") and at the same time ancestors of <title>.
        How to reproduce (all files are attached):
        run "java XSLTransform numbering63.xml numbering63.xsl"
        On JDK 6 it produces output presented in numbering63.ri but it should produce output like numbering63.expected.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  spericas Santiago Pericasgeertsen
                  Reporter:
                  ashurygisunw Alexey Shurygin (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: