You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by ppuyen <kh...@mail.ru> on 2009/01/13 00:06:19 UTC
Get element Class DOM !!!!
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.