From b2ce30230760e6cc0378ee2810b73fa8be1ff6d5 Mon Sep 17 00:00:00 2001 From: ser Date: Fri, 30 Dec 2005 16:35:45 +0000 Subject: All of the tickets and issues mentioned in this log can be found at: http://www.germane-software.com/projects/rexml/ticket/# where '#' is the issue or ticket number. * Fixes ticket:3 (Issue38 in Roundup.) However, this needs further testing. * Fixed a couple of bugs in the SAX2 parser, plus a bunch of other changes I don't remember. * More XPath ordering testing added * Fixed the documentation WRT the raw mode of text nodes (ticket:4) * Fixes roundup issue 43: substring-after bug. See: http://www.germane-software.com/cgi-bin/roundup/rexml/issue43 * Fixed issue44, Element#xpath * Patch submitted by an anonymous doner to allow parsing of Tempfiles. I was hoping that, by now, that whole Source thing would have been changed to use duck typing and avoid this sort of issue... but in the meantime, the patch has been applied. * Fixes ticket:30, XPath default namespace bug. The fix was provided by Lucas Nussbaum. * Aliases #size to #length, as per zdennis's request. * Fixes typo from previous commit * Fixes ticket #32 (and adds a unit test) * Merges a user-contributed patch for issue #40 * Changes Date, Version, and Copyright to upper case, to avoid conflicts with the Date class. * Minor, yet incomplete, documentation changes. * Resolves issue #34 (SAX parser change makes it impossible to parse IO feeds.) * Moves parser.source.position() to parser.position() * Improves the build script (less work for me to package a distribution) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/xpath_parser.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/rexml/xpath_parser.rb') diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb index 7c0d1dc35..fbfe60874 100644 --- a/lib/rexml/xpath_parser.rb +++ b/lib/rexml/xpath_parser.rb @@ -152,9 +152,10 @@ module REXML #puts "IN QNAME" prefix = path_stack.shift name = path_stack.shift - ns = @namespaces[prefix] - ns = ns ? ns : '' + default_ns = @namespaces[prefix] + default_ns = default_ns ? default_ns : '' nodeset.delete_if do |node| + ns = default_ns # FIXME: This DOUBLES the time XPath searches take ns = node.namespace( prefix ) if node.node_type == :element and ns == '' #puts "NS = #{ns.inspect}" @@ -347,7 +348,7 @@ module REXML preceding_siblings = all_siblings[ 0 .. current_index-1 ].reverse #results += expr( path_stack.dclone, preceding_siblings ) end - nodeset = preceding_siblings + nodeset = preceding_siblings || [] node_types = ELEMENTS when :preceding -- cgit