Closed Bug 192597 Opened 23 years ago Closed 23 years ago

XPath core function position() value error

Categories

(Core :: XSLT, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: kh, Assigned: peterv)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20021130 Build Identifier: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20021130 In an xsl style sheet using the core count function for determining the number of elements in the current context yields the correct value. In a template dealing with each of thes in turn, the core function position() produces 2, 4, 6, ... instead of 1,2,3,... This effect occurs at the root element children level, not at the grand-children level but occurs again at the great-grandchildren level Reproducible: Always Steps to Reproduce: 1. Write a style sheet including two templates as described above and a related simple xml document. 2. Run mozilla on the document 3. Admire the incorrect output I CAN SUPPLY A SMALL ZIP ARCHIVE WITH MINIMALIST STYLE SHEET AND DOCUMENT - ATTACHED Actual Results: 2, 4, 6, 8, ... Expected Results: 1, 2, 3, 4, ...
please see the bug reporting guidelines on http://www.mozilla.org/projects/xslt/ on how to attach useful testcases.
See also bug 192597
Hum, this is bug 192597. And thank you for not following the bug reporting guidelines! Sigh.
This works as expected. The <xsl:apply-templates/> will select all children below the current context-node. This includes the whitespace-textnode between the elements. If you change the text()-template to show the position you'll see that all positions are there. Change <xsl:apply-templates/> to <xsl:apply-templates select="*"/> and it should work as you want
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: