This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am iterating through a number of XML files looking for a certain content. If found, I want to have the parser stop searching and parsing other files. Is there any way of doing this? I am using a DOM parser.
So this question has nothing to do with XML parsing at all, then. Your task is to look at files in a folder until you find one which satisfies a certain condition, and then to stop processing. Yes, that's a beginner question. Let me move the thread over there. And while I'm doing that, how about posting what you have so far? (Note: it's best to leave the XML processing aside for now, i.e. put it into a separate method.)
Joined: Jan 12, 2010
Thanks for your replies. I have my DOM parser working where it parses the file that is passed to it and checks for the particular element.
Now, I am stepping back and looking at my code, and want to add that check of 'if element found, stop iterating over other files'.