Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

fetching data from xml based on a particualr pattern

 
neetha reddy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am having xml doc as
<hospitalname>
<rooms>
<general_ward>190</general_ward>
<special_ward>500</special_ward>
<semi_special_ward>500</semi_special_ward>
</rooms>
</hospitalname>

if i give ward in a jsp page it has to display the matches like
general_ward
special_ward
semi_special_ward etc.
how can i do this without using vb script
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way could be to write a "DOM walker" which goes through each node in a DOM tree, compares whether the node name ends with "ward", and adds the node into some list if it does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic