[Yanel-commits] rev 44039 - public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search

michi at wyona.com michi at wyona.com
Thu Aug 6 16:01:29 CEST 2009


Author: michi
Date: 2009-08-06 16:01:29 +0200 (Thu, 06 Aug 2009)
New Revision: 44039

Modified:
   public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java
   public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/TitleContentHandler.java
Log:
title xpath without xhtml prefix

Modified: public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java	2009-08-06 13:58:51 UTC (rev 44038)
+++ public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java	2009-08-06 14:01:29 UTC (rev 44039)
@@ -217,9 +217,11 @@
                     // NOTE: The tika meta data must not be null, hence we just declare something
                     org.apache.tika.metadata.Metadata tikaMetaData = new org.apache.tika.metadata.Metadata();
                     tikaMetaData.set("yarep:path", path);
+                    //parser.parse(in, new DebugContentHandler(), tikaMetaData);
                     parser.parse(in, new TitleContentHandler(writer), tikaMetaData);
                     //parser.parse(in, new org.apache.tika.sax.BodyContentHandler(writer), tikaMetaData);
                     //parser.parse(in, new org.apache.tika.sax.WriteOutContentHandler(writer), tikaMetaData);
+                    //String title = "TODO: Hello World!";
                     String title = writer.toString().trim();
                     log.warn("DEBUG: Title: '" + title + "'");
                     if (title.length() > 0) {

Modified: public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/TitleContentHandler.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/TitleContentHandler.java	2009-08-06 13:58:51 UTC (rev 44038)
+++ public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/TitleContentHandler.java	2009-08-06 14:01:29 UTC (rev 44039)
@@ -30,8 +30,8 @@
     /**
      * The XPath matcher used to select the XHTML title contents.
      */
-    private static final Matcher MATCHER =
-        PARSER.parse("/xhtml:html/xhtml:head/xhtml:title/descendant:node()");
+    //private static final Matcher MATCHER = PARSER.parse("/xhtml:html/xhtml:head/xhtml:title/descendant:node()");
+    private static final Matcher MATCHER = PARSER.parse("/html/head/title/descendant:node()");
 
     /**
      * Creates a content handler that passes all XHTML title events to the



More information about the Yanel-commits mailing list