Input appreciated: Trying to get data from a CDATA field out of an xml doc
using Nokogiri.

This is the node:
        <ATTACHED_DOCUMENT>
          <![CDATA[insert PDF code here]]>
        </ATTACHED_DOCUMENT>

When I query I am getting at best empty string, where I should expect the
text "insert PDF code here". This is what I have tried, without success:

xml_request_doc.xpath("//attached_document")
returns: [#<Nokogiri::XML::Element:0x1252bfe name="attached_document">]

xml_request_doc.xpath("//attached_document/text()")
returns: []

xml_request_doc.xpath("//attached_document").value
returns: NoMethodError Exception: undefined method `value' for
[#<Nokogiri::XML::Element:

xml_request_doc.xpath("//attached_document").inner_html
returns: ""

Any thoughts where going wrong (I am successfully using Nokogiri for every
other element in my doc.

Thx!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to