aspose file tools*
The moose likes XML and Related Technologies and the fly likes XML keyword search Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic
Author

XML keyword search

krishna moorthyv
Greenhorn

Joined: Dec 13, 2012
Posts: 7
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

Where is your code? What problems are you having with it? Please be sure to read NotACodeMill.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

I've closed this due to a new topic being posted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML keyword search