tags:

views:

74

answers:

1

Hi, I am developing an application for iPhone.I need to remove html entities like ["<p>"] in a parsed xml response.Is there any direct way to remove all such entities.??

A: 

How is the data formatted? Are the HTML entities esacaped in the original XML, something like this:

<xml><content type="html">&lt;p&gt;A paragraph.&lt;/p&gt;</content></xml>

In this case you could just strip the tags with a regular expression.

Otherwise, I would suggest following the DTD of the XML file, and stripping all other tags under the assumption that they don't constitute part of the XML markup.

Paul Lammertsma