Re: [Htmlparser-user] TagNameFilter
Brought to you by:
derrickoswald
|
From: Derrick O. <der...@ro...> - 2007-12-07 13:15:53
|
The accept() method is used by the visitor pattern, not the filter paradigm.
It's not clear what string you are trying to 'do not match'.
The <p> tag has no string. Maybe you mean the string between <p> tags,
or if you've made the <p> tag composite, then maybe it's children.
You should probably just add more filtering clauses, e.g.
parser.extractAllNodesThatMatch(new AndFilter (new TagNameFilter("p"), ...));
I would suggest you try the FilterBuilder application to build up your filter.
----- Original Message ----
From: "at...@gm..." <at...@gm...>
To: htmlparser user list <htm...@li...>
Sent: Thursday, December 6, 2007 2:09:07 PM
Subject: [Htmlparser-user] TagNameFilter
Hi,
i need some help with the TagNameFilter.
I have a function to get all the p tags out a html document.
NodeList nl = parser.extractAllNodesThatMatch(new TagNameFilter("p"));
But now i want to filter from the NodeList all entries that do not
match a
special string.
I guess the key would be the "accept() function" but im unsure how to
implement it(well the string compare etc is clear but the usage of the
accept() + Tag.class ).
And furthermore i have problems with doubled entries because of nested
p
tags.
Thanks
Alex
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Htmlparser-user mailing list
Htm...@li...
https://lists.sourceforge.net/lists/listinfo/htmlparser-user
|