This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to pass a String which contain xml data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to pass a String which contain xml data" Watch "how to pass a String which contain xml data" New topic
Author

how to pass a String which contain xml data

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1072
I need to pass a String which contain xml data.below is the String .Can i use Sax parser for this ?

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

What do you mean by "pass" a String? Do you mean: parse a String? Yes, you could use a SAX parser or any other kind of XML parser for that.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1072
can we use this in android.Because i am getting above XML String in Android as a input.I need to extract data from that String.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Yes, Android has a SAX parser built in. You should not normally use XML without an XML declaration that specifies the encoding, though.


Ping & DNS - my free Android networking tools app
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1072
thanks ULF.
 
jQuery in Action, 2nd edition
 
subject: how to pass a String which contain xml data
 
Similar Threads
Trying to add xmlns attribute to a <result> tag in my xml response
i am getting HttpHostConnectException
data service url gives error
need to add namespace to <result> tag from a .jca file
An Unwanted Part of the XML Input File is Included in the XSL Transformation Result