This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: fetching data from xml based on a particualr pattern
 
Similar Threads
CMP 2.0 problem with MySQL server
CMP beans not entering data in database
CMP 2.0 problem in Jboss 4.0.2
Storing XML document in Database
Entity Bean on JBoss4.0.2