• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parsing String which comes as xml

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..


 
Marshal
Posts: 79415
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult for "beginning Java". Moving thread.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Marshal
Posts: 28262
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

yekkala , please find the implementation below


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic