• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing String which comes as xml

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult for "beginning Java". Moving thread.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any XML parser can do that. Check out the DOM and SAX APIs in the javax.xml.parsers package.
 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

yekkala , please find the implementation below


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic