I’m testing the REXML module (Ruby 1.8).
I have this simple XML ducument “test.xml”:
vxml:prompt
You have chosen to stay at the
<vxml:value expr=“field_hotel”/> tonight
</vxml:prompt>
which I analyse with this script:
require "rexml/document"
include REXML
file=File.new(“test.xml”)
doc=Document.new file
doc.elements.each(“vxml:prompt”) do |element|
puts “Text:” + element.text
element.elements.each() do |child|
puts “SubElement:” + child.name
end
end
The output is
Text:
You have chosen to stay at the
SubElement:value
The “text” method only returns the first “text node” in the prompt
element,
and there is only one child element. So apperantly text nodes are not
part
of the child elements array…
How do I access the remaining text?
I assume this is possible, but unfortunately the
http://www.germane-software.com/software/rexml seems to
be down today, so I can’t get to the documentation.
Cheers
Jesper