Project

General

Profile

Actions

Bug #3842

closed

REXML gives NoMethodError when using parentheses in Xpath selection criteria

Added by halfgaar (Wiebe Cazemier) over 14 years ago. Updated about 14 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Backport:
[ruby-core:32447]

Description

=begin
When using a selection criterion as follows:

xmldoc.elements.each("descendant::node()[(local-name()='link' or local-name()='a') and @rel='sub']")

It gives:

/usr/lib/ruby/1.9.1/rexml/xpath_parser.rb:437:in expr': undefined method inject' for true:TrueClass (NoMethodError)

But when leaving out the parentheses around two two local-name functions, it works fine.

It also worked fine on Ruby 1.8.
=end


Files

rexmlbug.rb (1 KB) rexmlbug.rb example script to show a bug in REXML's xpath parsing when parentheses are used in selection criteria halfgaar (Wiebe Cazemier), 09/17/2010 04:00 AM
Actions #1

Updated by kou (Kouhei Sutou) over 14 years ago

  • Category set to lib
  • Status changed from Open to Closed
  • Assignee set to kou (Kouhei Sutou)

=begin
I've fixed it in trunk.

Thanks for reporting!
=end

Actions

Also available in: Atom PDF

Like0
Like0