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.
posted 8 years ago
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.