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 XML keyword search 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
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: 60740
    
  65

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: 60740
    
  65

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
 
Similar Threads
XML file parsing in Java using SAX
Dom to JAXB
How to get a xml id value in java
code to read the xml and also overide the value of certain attributes in xml at runtime itself
The pain of a beginner developer - deciphering cryptic documentation and such