class REXML::Element
def text( path = nil )
and so is always normalized text.
Note also that the text note is retrieved by method get_text,
Even so, the returned value is the string text from the first such node.
possibly separated by other non-text children, as above.
Note that an element may have multiple text nodes,
d.root.text(1) # => "this is bold!"
in the element that matches +xpath+:
With argument +xpath+, returns text from the first text node
d.root.text # => "some text "
d.root.text.class # => String
d = REXML::Document.new "
some text this is bold! more text
"With no argument, returns the text from the first text node in +self+:
in a specified element, if it exists, +nil+ otherwise.
Returns the text string from the first text node child
text(xpath = nil) -> text_string or nil
:call-seq:
def text( path = nil ) rv = get_text(path) return rv.value unless rv.nil? nil end