summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/rexml/element.rb8
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index dc2e407..41f93f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jan 3 17:42:32 2013 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rexml/element.rb (REXML::Elements#each): Add missing
+ "elements" in document. [ruby-talk:402713]
+ Reported by Wesley Rishel. Thanks!!!
+
Thu Jan 3 15:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
* ext/psych/lib/psych.rb (Psych.load): Return value of
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb
index 83e5f6e..f982599 100644
--- a/lib/rexml/element.rb
+++ b/lib/rexml/element.rb
@@ -895,11 +895,11 @@ module REXML
# that XPaths are automatically filtered for Elements, so that
# non-Element children will not be yielded
# doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
- # doc.root.each {|e|p e} #-> Yields b, c, d, b, c, d elements
- # doc.root.each('b') {|e|p e} #-> Yields b, b elements
- # doc.root.each('child::node()') {|e|p e}
+ # doc.root.elements.each {|e|p e} #-> Yields b, c, d, b, c, d elements
+ # doc.root.elements.each('b') {|e|p e} #-> Yields b, b elements
+ # doc.root.elements.each('child::node()') {|e|p e}
# #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/>
- # XPath.each(doc.root, 'child::node()', &block)
+ # XPath.elements.each(doc.root, 'child::node()', &block)
# #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>
def each( xpath=nil )
XPath::each( @element, xpath ) {|e| yield e if e.kind_of? Element }