Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

I need to do a post and then parse XML returned

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been agiven a uRL whihc returns XML. I need to do post and then parse the XML that is returned. What is the bext way to get this done?
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Hemal Mehta:
I have been agiven a uRL whihc returns XML. I need to do post and then parse the XML that is returned. What is the bext way to get this done?


Already ur given URL is returing XML,then why u need to post it again or what u want to post.
Bit confusing for me..
Can u plz ask more clearly.?
 
Hemal Mehta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok this is what I need to do:
I have been give a URL. I need to do a post and the URL will return me a XML doc. I need to parse that out. So I am just wondering how I could do it....
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Hemal Mehta:
Ok this is what I need to do:
I have been give a URL. I need to do a post and the URL will return me a XML doc. I need to parse that out. So I am just wondering how I could do it....


Let me Try!..
When u make a post,u will get the corresponding XML doc OK?
Now u can store this in local temp folder and ask DOM/SAX to parse it
Or u can directly give this to DOM/SAX as a string and start parsing.
All this can be achieved by servlet which little effort.
HTH
Regards
Balaji
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just take the InputStream from the URLConnection and feed it to any XML parser that takes an InputStream. You treat it just as if it was reading a local file as a FileInputStream.
Bill
(Incidently - why do some people write like this

Can u plz ask more clearly.?


You are not being charged by the character here, why not write in complete words and sentences?
Just curious - Bill)
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry William,
Next time i will sure try to make it perfect.
Regards
Balaji
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic