Search the web
Sign In
New User? Sign Up
xmlpull-user
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How do I retain character entities in my xml output?   Message List  
Reply | Forward Message #207 of 308 |
Re: [xmlpull-user] How do I retain character entities in my xml output?

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




Mon Mar 7, 2005 9:43 pm

as10m
Offline Offline
Send Email Send Email

Forward
Message #207 of 308 |
Expand Messages Author Sort by Date

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...
bonniezeller
Offline Send Email
Mar 7, 2005
8:58 pm

... use XmlPullParser.nextToken() instead of next() and entityRef in XmlSerializer ...
Aleksander Slominski
as10m
Offline Send Email
Mar 7, 2005
9:47 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help