lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppuyen <khongkh...@mail.ru>
Subject Get element Class DOM !!!!
Date Mon, 12 Jan 2009 23:06:19 GMT

 hi everyone,
I run example Indexing files HTML from "Lucene in Action " . 
there can getTitle and getBody of file HTML .

 protected String getTitle(Element rawDoc) {
    if (rawDoc == null) {
      return null;
    }
    String title = "";

    NodeList children = rawDoc.getElementsByTagName("title");
    if (children.getLength() > 0) {
      Element titleElement = ((Element) children.item(0));
      Text text = (Text) titleElement.getFirstChild();
      if (text != null) {
        title = text.getData();
      }
    }
        System.out.println("getTitle:"+ title);
    return title;
  }

But now I want to get Price $45 from this tag  "$45.00 

help me, please

"
-- 
View this message in context: http://www.nabble.com/Get-element-Class-DOM-%21%21%21%21-tp21425976p21425976.html
Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message