• 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

I need to parse the data of my webservice response.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need to parse the data of my webservice response.
which looks like
<ul class="jive-sidebar-populartags">
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=abc&recursive=true" title="Used 1 times">abc</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=forthone&recursive=true" title="Used 1 times">forthone</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=hi&recursive=true" title="Used 1 times">hi</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=ho&recursive=true" title="Used 1 times">ho</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=jai&recursive=true" title="Used 1 times">jai</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=my&recursive=true" title="Used 1 times">my</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=myblog&recursive=true" title="Used 1 times">myblog</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=new&recursive=true" title="Used 1 times">new</a></li>
<li class="jive-tagset-popularity9"><a href="http://localhost:8080/jive_sbs/tags?tags=one&recursive=true" title="Used 2 times">one</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=question&recursive=true" title="Used 1 times">question</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=second&recursive=true" title="Used 1 times">second</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=taggggggggggggggggggggggggggggggg&recursive=true" title="Used 1 times">taggggggggggggggggggggggggggggggg</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=third&recursive=true" title="Used 1 times">third</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=yea&recursive=true" title="Used 1 times">yea</a></li>
</ul>
<p class="jive-sidebar-viewall">
<a href="http://localhost:8080/jive_sbs/tags&recursive=true">View all</a>
</p>

need to get the values between the links for example in the first link it is "abc"; if you can give codeAPI would be of great help

please help
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi himan,
Have you solved it?

I recommend using XMLBeans from apache to read the xml.

Yeah, you have to read the tutorial and try yourself but at the end you'll
enjoy the way XMLBeans handles the xmls files.

Have a look at this tutorial: http://xmlbeans.apache.org/documentation/tutorial_getstarted.html

Have fun.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Himan,

As long as you pass a well-formed XML, any XML parser, such as DOM, SAX, etc. can parse it.

I'm not sure you deal here with well-formed XML. Got the following message from IE when trying to view your data (after introducing a root element) -

A semi colon character was expected.



BTW, do you pass plain HTML in the response?

Regards,
Dan
 
reply
    Bookmark Topic Watch Topic
  • New Topic