#45 Add to ignoreCase parameter to HasAttributeFilter

Next Release
open
nobody
5
2006-05-15
2006-05-15
No

I can't make a search for <meta name="robots" value=".
.."> tags using current filters:

NodeList metas = parser.
extractAllNodesThatMatch(
new AndFilter(
new
NodeClassFilter(MetaTag.class),
new OrFilter(
new
HasAttributeFilter("name", "robots"),
new
HasAttributeFilter("name", "googlebot"))));

This is because "robots" can be written using lower-
case, upper-case or for example like "rObOTs".

I propose to add ignoreCase parameter to the
HasAttributeFilter filter, like so:

NodeList metas = parser.
extractAllNodesThatMatch(
new AndFilter(
new
NodeClassFilter(MetaTag.class),
new OrFilter(
new
HasAttributeFilter("name", "robots", true),
new
HasAttributeFilter("name", "googlebot", true))));

This will allow returning all the attributes with the
specified "attribute" and "value" even if "value" is
actually written in a different case.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks