Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Get All Text Children Of An XML Elment

DZone's Guide to

Get All Text Children Of An XML Elment

·
Free Resource
Presuming the element you want the text from is element:


REXML::XPath.match(element, './/text()').inject { |str, text| str << text.to_s }


Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}