* lib/rexml/element.rb (REXML::Elements#each): Add missing
"elements" in document. [ruby-talk:402713] Reported by Wesley Rishel. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3e028faf7c
commit
ece67a0a12
@ -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>
|
Thu Jan 3 15:13:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
* ext/psych/lib/psych.rb (Psych.load): Return value of
|
* ext/psych/lib/psych.rb (Psych.load): Return value of
|
||||||
|
@ -895,11 +895,11 @@ module REXML
|
|||||||
# that XPaths are automatically filtered for Elements, so that
|
# that XPaths are automatically filtered for Elements, so that
|
||||||
# non-Element children will not be yielded
|
# non-Element children will not be yielded
|
||||||
# doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
|
# 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.elements.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.elements.each('b') {|e|p e} #-> Yields b, b elements
|
||||||
# doc.root.each('child::node()') {|e|p e}
|
# doc.root.elements.each('child::node()') {|e|p e}
|
||||||
# #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/>
|
# #-> 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/>
|
# #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>
|
||||||
def each( xpath=nil )
|
def each( xpath=nil )
|
||||||
XPath::each( @element, xpath ) {|e| yield e if e.kind_of? Element }
|
XPath::each( @element, xpath ) {|e| yield e if e.kind_of? Element }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user