• Post Reply Bookmark Topic Watch Topic
  • New Topic

I need to parse the data of my webservice response.  RSS feed

himan Gupta
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
<p class="jive-sidebar-viewall">
<a href="http://localhost:8080/jive_sbs/tags&recursive=true">View all</a>

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
Cristian Boariu
Posts: 9
  • Mark post as helpful
  • send pies
  • 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.
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!