Platinum Partner

Use Texts To Find All Text Elements

REXML::Element::texts returns all text elements within a leaf node.

doc_b = Document.new("\n333    456")
#=>  ... 
irb(main):434:0> doc_b.root.elements['a'].text
#=> "\n"
irb(main):433:0> doc_b.root.elements['a'].texts
#=> ["\n", "  ", "  456"]


I discovered this while browsing Use has_elements to find children in REXML [dzone.com]
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}