[Simple-support] how to serialize/deserialize html style tags within an element
Brought to you by:
niallg
|
From: Gar Ng <ga...@gm...> - 2012-08-13 19:22:07
|
Hi,
I have some xml documents that contain html inside an element. An example
is as follows:
<person>
<firstName>Bob<firstName>
<notes>
<html: p>
Bob is <strong>severely</strong> allergic to peanuts
</html: p>
</notes>
</person>
I attempted to create a converter to handle this case.
The current api allows me to create child elements and write a value to the
current element but is there a way to handle this case where a style
element is embedded in the text? When attempting to read it in, the value
on the inputNode appears to only contain the text up to the <strong> tag,
everything after the child element <strong> does not appear to be in the
inputNode. Conversely, there is no way to create an output node with this
structure either.
The only solution that I can think of would be to wrap the <notes> or <p>
element in CDATA before reading and then do some post processing to remove
the CDATA tag after writing. Is there a better way to do this?
Thanks,
Gary
|