How to get mixed content of an xml element?
The following examples demonstrate how to read mixed content of an xml element. A mixed content can have more than one type of content such as text (
Text), comment (
Comment), CDATA (
CDATA) or some child elements (
You also see that we can remove the mixed content from the element by calling the
remove method of the List just like what we do with a collection of data.
Here are the result of our program:
Comment = [Comment: <!-- This element contains application data -->]
Text = [Text: User Information]
CDATA = [CDATA: <table><tr><td>-data-</td></tr></table>]
Element = [Element: <field/>]