Thanks Gary, I had been trying the .children, and tried what you
suggested to be sure, and I get nil as the return value for
cdata_node = parent_node.children.detect {|n| n.cdata?}
It is very strange - the following is the xml in text before creating
the Nokogiri doc, and it says <ATTACHED_DOCUMENT> has no children, and
does not seem to be any other objects inside the attached_document
node in the Nokogiri doc:
maybe try .cdatas on the parent node rather than children. Not sure
about Nokogiri but such a method exists for rexml/document.
Thanks. It does work with REXML, out of the box, no fiddling. I like
Nokogiri’s speed but am finding it harder to work with - maybe it is
just getting used to and I don’t understand things, but aside from
this what else I find a little strange is when Nokogiri matches on a
node/element it wants everything in lowercase, even if my xml is
uppercase. Anyhow +1 for old REXML.