diff options
| author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-08 01:53:33 +0000 |
|---|---|---|
| committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-08 01:53:33 +0000 |
| commit | 0dd6985ec5a467375d8cf63193fe31a3181a9699 (patch) | |
| tree | 801ef38e4081aec080ac1ce1d3ca3f1273ba861e /lib/rexml/xpath.rb | |
| parent | 13578f377dfa575ee44980e08a1dae0190af8c2a (diff) | |
| download | ruby-0dd6985ec5a467375d8cf63193fe31a3181a9699.tar.gz ruby-0dd6985ec5a467375d8cf63193fe31a3181a9699.tar.xz ruby-0dd6985ec5a467375d8cf63193fe31a3181a9699.zip | |
Merged changes from REXML 3.1.5.
The list of bug fixes/enhancements is at:
http://www.germane-software.com/projects/rexml/query?status=closed&milestone=3.1.5
Merged Nobu's & DrBrain's changes into REXML head.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/xpath.rb')
| -rw-r--r-- | lib/rexml/xpath.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rexml/xpath.rb b/lib/rexml/xpath.rb index 1ed440868..939399e28 100644 --- a/lib/rexml/xpath.rb +++ b/lib/rexml/xpath.rb @@ -19,9 +19,9 @@ module REXML # XPath.first( node ) # XPath.first( doc, "//b"} ) # XPath.first( node, "a/x:b", { "x"=>"http://doofus" } ) - def XPath::first element, path=nil, namespaces={}, variables={} - raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.kind_of? Hash - raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of? Hash + def XPath::first element, path=nil, namespaces=nil, variables={} + raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.nil? or namespaces.kind_of?(Hash) + raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of?(Hash) parser = XPathParser.new parser.namespaces = namespaces parser.variables = variables @@ -42,9 +42,9 @@ module REXML # XPath.each( node ) { |el| ... } # XPath.each( node, '/*[@attr='v']' ) { |el| ... } # XPath.each( node, 'ancestor::x' ) { |el| ... } - def XPath::each element, path=nil, namespaces={}, variables={}, &block - raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.kind_of? Hash - raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of? Hash + def XPath::each element, path=nil, namespaces=nil, variables={}, &block + raise "The namespaces argument, if supplied, must be a hash object." unless namespaces.nil? or namespaces.kind_of?(Hash) + raise "The variables argument, if supplied, must be a hash object." unless variables.kind_of?(Hash) parser = XPathParser.new parser.namespaces = namespaces parser.variables = variables @@ -54,7 +54,7 @@ module REXML end # Returns an array of nodes matching a given XPath. - def XPath::match element, path=nil, namespaces={}, variables={} + def XPath::match element, path=nil, namespaces=nil, variables={} parser = XPathParser.new parser.namespaces = namespaces parser.variables = variables |
