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

XML keyword search

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
For an XML keyword search project, users may search any value in the XML code

<?xml version="1.0" encoding="UTF-8"?>
<company>
<staff id="1001">
<firstname>sachin</firstname>
<lastname>tendulkar</lastname>
<nickname>TON</nickname>
<salary>100000</salary>
</staff>
<staff id="2001">
<firstname>MS</firstname>
<lastname>Dhoni</lastname>
<nickname>MSD</nickname>
<salary>200000</salary>
</staff>
<staff id="3001">
<firstname>yuraj</firstname>
<lastname>singh</lastname>
<nickname>yuvi</nickname>
<salary>200000</salary>
</staff>
</company>

If the user searches for 20000, the result will available in ID 1001 and 2001 so the output should be like:

ms
dhoni
msd
200000

yuraj
singh
yuvi
20000
I need code to do this in Java.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Where is your code? What problems are you having with it? Please be sure to read NotACodeMill.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I've closed this due to a new topic being posted.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic