Ticket #79 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

name selection does not work with numbers

Reported by: kkalmbach Owned by: ser
Priority: normal Milestone: 3.1.7
Component: XPath Version: 3.1.3
Severity: normal Keywords:
Cc: Ruby version: 1.8.2
Operating system: Windows

Description

In this test, I the first test case (select using a "c" named test) works fine.

In the second case, I can not select using a "c" named 3. I tried with and without the quotes around c.

class MyTester < Test::Unit::TestCase

def testNumberNames
  source = "<a><b><c>test</c></b><b><c>3</c></b></a>"
  d = REXML::Document.new( source )
  r = REXML::XPath.match( d, %q{/a/b[c='test']} )
  assert_equal(1, r.size())
  r = REXML::XPath.match( d, %q{/a/b[c='3']} )
  assert_equal(1, r.size())
end

end

Here are my version #'s

["3.1.4", "1.8.4", "2006-04-14"]
REXML version = 3.1.4
Loaded suite REXML

Change History

Changed 2 years ago by ser

  • milestone changed from 3.1.6 to 3.1.7

Changed 2 years ago by ser

  • status changed from new to closed
  • resolution set to fixed

This was fixed in an earlier commit. A unit test confirming that this error no longer occurs has been added by changeset:1243

Note: See TracTickets for help on using tickets.