Bugs: Browse | Submit New | Admin

[#893] Indexes in XPaths returned from full_path() are wrong

Date:
2004-09-15 22:22
Priority:
3
Submitted By:
John Labovitz (johnl)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Indexes in XPaths returned from full_path() are wrong

Detailed description
The method child_index(), in file "rexml-nodepath.rb", is incorrectly returning 0-based indexes for XPath
elements. They should be 1-based. This causes the full_path() method to return paths that aren't valid.

I've included a patch that fixes the problem, a unit-test to test it, and a patch for test_scripts.rb that corrects
a bad XPath that takes advantage of the bug.

Cheers,
--john

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
patch-rexml-nodepath.patch patch for test_scripts.rb & rexml-nodepath.rb Download

Changes:

Field Old Value Date By
File Added76: patch-rexml-nodepath.patch2004-09-15 22:22johnl