You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ju...@apache.org on 2011/01/19 14:46:27 UTC

svn commit: r1060813 - /tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java

Author: jukka
Date: Wed Jan 19 13:46:27 2011
New Revision: 1060813

URL: http://svn.apache.org/viewvc?rev=1060813&view=rev
Log:
TIKA-581: Parser fails on files that parsed with v0.7

Avoid problems caused by double close tags sometimes returned by tagsoup

Modified:
    tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java

Modified: tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java?rev=1060813&r1=1060812&r2=1060813&view=diff
==============================================================================
--- tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java (original)
+++ tika/trunk/tika-core/src/main/java/org/apache/tika/sax/xpath/MatchingContentHandler.java Wed Jan 19 13:46:27 2011
@@ -72,7 +72,11 @@ public class MatchingContentHandler exte
         if (matcher.matchesElement()) {
             super.endElement(uri, localName, name);
         }
-        matcher = matchers.removeFirst();
+        // Sometimes tagsoup returns double end tags, so the stack might
+        // be empty! TODO: Remove this when the tagsoup problem is fixed.
+        if (!matchers.isEmpty()) {
+            matcher = matchers.removeFirst();
+        }
     }
 
     public void characters(char[] ch, int start, int length)