aspose file tools*
The moose likes XML and Related Technologies and the fly likes Parsing String which comes as xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Parsing String which comes as xml" Watch "Parsing String which comes as xml" New topic
Author

Parsing String which comes as xml

yekkala krishna
Ranch Hand

Joined: Mar 04, 2007
Posts: 105
Hi,

In my application I am receiving xml as a String. I want to parse the String now.Below is my xml coming as string.
<m:notify>
<header:standardHeader>
<header:e2e>
<header:E2EDATA>busProcOriginator=IRAMS,busProcType=notify,busTxnType=MENNotifications</header:E2EDATA>
</header:e2e>
<ms1:meNm>ins-2</ms1:meNm>.....

I want to parse the data coming form ms1:meNm tag...

Could you suggest how to solve this issue..

Thanks in Advance..


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
Too difficult for "beginning Java". Moving thread.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41530
    
  53
Any XML parser can do that. Check out the DOM and SAX APIs in the javax.xml.parsers package.


Ping & DNS - my free Android networking tools app
yekkala krishna
Ranch Hand

Joined: Mar 04, 2007
Posts: 105
Hi Ulf,

I am able to parse xml with the help of DOM parser.But in my application i am getting xml as String format.So please suggest me a better way to solve this issue.

Thanks in advance...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

So you have a string. And you want to parse it with a DOM parser. Why do you think there is anything preventing you from doing that?
Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83

yekkala , please find the implementation below




SCJP 1.4,SCWCD5, SCBCD5
Thanks, Santhosh
 
Don't get me started about those stupid light bulbs.
 
subject: Parsing String which comes as xml