title: How to parse plain text file with occasional XML tags using Java and SAX?
body: <p>I have a rather large log file from a server which contains plain text. The server logs every thing it does and occasionally it prints xml tags which I am interested in parsing. To give you an example:</p>
  
  <pre><code>-----------log file-------------
  bla bla bla random text
  &lt;logMessage&gt;test Message&lt;/logMessage&gt;
  some more random server output
  &lt;logMessage&gt;some other message&lt;/logMessage&gt;
  bla bla bla
  end of log file
  </code></pre>
  
  <p>I just want to extract the data from the &lt; logMessage > tags and ignore the rest. I am using Java and SAX, but the SAX parser expects the content of the file to be strictly XML formatted and it cannot handle this type of file. Is there a way to tell SAX to ignore/overlook the fact that the file is not a well formatted XML?
  What's the alternative? read the file line by line and look for the tags? :(</p>