aspose file tools*
The moose likes XML and Related Technologies and the fly likes fetching data from xml based on a particualr pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "fetching data from xml based on a particualr pattern" Watch "fetching data from xml based on a particualr pattern" New topic
Author

fetching data from xml based on a particualr pattern

neetha reddy
Greenhorn

Joined: Apr 13, 2004
Posts: 1
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: fetching data from xml based on a particualr pattern