Suppose I have the following XML structure:
<root>
<item>
<item1>some text is <b>here</b></item1>
<item2>more text is here</item2>
</item>
</root>
I can parse the xml using something like:
$(responseXML).find('item').each(function(){
var first_text = $(this).find('item1').text();
var second_text = $(this).find('item2').text();
}
But the html is not preserved when using .text(). html() is not available for xml in jquery.
Any ideas on how to keep the inner html when parsing the xml?
nest the sections you don’t want interpreted as xml within CDATA sections
e.g.
EDIT: Note, if using .text() doesn’t work, try the following:
Quoting from: http://dev.jquery.com/ticket/2425