-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
Description
Hi,
I'm probably missing somehing but I am trying to figure out if it is possible to consider the body of a particular element as sometihng that does not need to be nested into (as is done in the below example with the granular tokenizing of the HTML elements inside the "body" element). I can see the logic for the outcome I'm getting but if I would like it just as one big CDATA is there any way I can specify that?
My goal is to simply extract the "body" as one erlang binary.
Thanks,
7> fxml_stream:parse_element(<<"<message><body>?OTRv2?\n<b>bob@acme.com</b> has requested an <a href=\"http://otr.cypherpunks.ca/\">Off-the-Record private conversation</a>. However, you do not have a plugin to support that.\nSee <a href=\"http://otr.cypherpunks.ca/\">http://otr.cypherpunks.ca/</a> for more information.</body></message>">>).
{xmlel,<<"message">>,[],
[{xmlel,<<"body">>,[],
[{xmlcdata,<<"?OTRv2?\n">>},
{xmlel,<<"b">>,[],[{xmlcdata,<<"bob@acme.com">>}]},
{xmlcdata,<<" has requested an ">>},
{xmlel,<<"a">>,
[{<<"href">>,<<"http://otr.cypherpunks.ca/">>}],
[{xmlcdata,<<"Off-the-Record private conversation">>}]},
{xmlcdata,<<". However, you do not have a plugin to support that"...>>},
{xmlel,<<"a">>,
[{<<"href">>,<<"http://otr.cypherpunks.ca/">>}],
[{xmlcdata,<<"http://otr.cypherpunks.ca/">>}]},
{xmlcdata,<<" for more information.">>}]}]}