Re: [Simple-support] how to serialize/deserialize html style tags within an element
Brought to you by:
niallg
|
From: Niall G. - Y. <Nia...@yi...> - 2012-08-14 00:02:28
|
Hi Gary,
Currently the string "Bog is" and "allergic to peanuts" will not be accessible through the InputNode. Ill be adding some changes to allow this in future, but currently CDATA is your best option.
Niall
From: Gar Ng [mailto:ga...@gm...]
Sent: Tuesday, 14 August 2012 5:22 AM
To: sim...@li...
Subject: [Simple-support] how to serialize/deserialize html style tags within an element
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
|