views:

141

answers:

1

I'm new to parsing XML and am having an issue with entities. (Am doing this on Android, if it makes a difference).

Is there a way to have it turn an entity into the character it represents? I have this in the child of an element: "isn't" (minus quotes). I would prefer it parse it and the end result be a single text node. However, right now this is turned in to TEXT, ENTITY, TEXT.

Is there a way to automatically have it parse the entity into text, or a manual way to do it?

A: 

You can't automatically do that, since this is the expected behaviour. It's up to the interpreter what to do with the entities. The average webbrowser for example will interpret and display them flawlessly.

If you're allowed to join a 3rd party library, then I'd suggest to use the Apache Commons Lang StringEscapeUtils#unescapeXml() for this.

BalusC