bonniezeller wrote:
>I am using XmlPullParser to parse an xml input string and output
>portions of it to a string buffer. I am using next() to obtain
>events. When I have an event type of TEXT, I use getText() to obtain
>the text. However, if the text contains a standard character entity,
>such as &, it is converted to an ampersand. How do I avoid that
>conversion so that I can output the character entity rather than the
>ampersand? I have read the documentation, but I am still confused.
>
>
use XmlPullParser.nextToken() instead of next() and entityRef in
XmlSerializer
http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/XmlPullParser.html#nextToken()
http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/XmlSerializer.html#entityRef(ja\
va.lang.String)
XPP3 supports roundtrip feature and it allows you to reproduce exact XML
input:
http://xmlpull.org/v1/doc/features.html#xml-roundtrip
HTH,
alek
--
The best way to predict the future is to invent it - Alan Kay