This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi, I have lot of xml files , they are differents, I have like more than 200 strings in a text file each string in a line, I want to search for these strings patterns in these XML files, please do you have an idea or do you know a code that does that ? thanks, your help is appreciated.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35247
7
posted
0
The simplest approach would be to treat the files as plain text, and read them line by line and look for the search string. This could be made a lot more efficient by using a search library like Lucene.
If you need precise control over which parts of an XML file are searched, have a look at XQuery, which is a standard for searching XML. One Java implementation is Nux, which sits on top of the excellent XOM library.