Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CDATA more accessible #40

Closed
paulvt opened this issue Feb 21, 2013 · 1 comment
Closed

Make CDATA more accessible #40

paulvt opened this issue Feb 21, 2013 · 1 comment

Comments

@paulvt
Copy link

paulvt commented Feb 21, 2013

CDATA is usually just used as a way to escape text, but there is no real nice API to reach it in Ox. For example, compare <foo>bar</foo> and <quux><![CDATA[<garply>nice</garply>]]></quux> when trying to reach the text/literal data:

foo_xml.text
#=> "bar"
quux_xml.nodes.first.value
#=> "<garply>nice</garply>"

I am aware that <quux> could have had multiple CDATA nodes, but the same holds for <foo> containing mixed strings and elements, then #text also returns the first string node. Additionally, I should also have checked that quux_xml.nodes.first is even a CData node.

@ohler55
Copy link
Owner

ohler55 commented Feb 22, 2013

Reference issue 41 and closing this one.

@ohler55 ohler55 closed this as completed Feb 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants