[Htmlparser-developer] Re: Extending HasAttributeFilter
Brought to you by:
derrickoswald
From: Ian M. <ian...@gm...> - 2006-05-08 14:17:51
|
I would also like to be able to set the attribute as null but the attribute value as not-null. In this case, it should attempt to match all attributes against the attribute value. Please email me if you have any objections to this (or anything else). Thanks Ian Macfarlane On 5/8/06, Ian Macfarlane <ian...@gm...> wrote: > I would like to add the following functionality to HasAttributeFilter: > > 1) A boolean flag to set if the matching should be case-insensitive. I > think this could be done with a boolean, one new constructor (String > attribute, String value, boolean attribValue) and get/set method pair. > > 2) A flag to mark that the attribValue should be parsed as a regular > expression (I don't really see the benefit of doing this with the tag > name). This should also obey the case-sensitivity rule in (1). For > this, I imagine a further constructor and get/set method pair. (a > sample use case of this is "post\d+" to match post1, post22, > post343545, etc). > > > I'm willing to go ahead and code these, but I thought I should run > this past you other developers too in case you dislike either idea. > I'm also open to either: > > a) putting the regexp stuff in a subclass of HasAttributeFilter (but > it seems a small enough change to be suitable as part of the class > size-wise). > > b) changing the one/two boolean constructors to be one constructor > that takes an INT flag, and add flags for the different combinations > (e.g. CASE_SENSITIVE =3D 1, USE_REGEX =3D 2, so both together would be 3)= . > This seems unnecessarily complex, and doing it the way I suggested > above still allows for this in the future if desired. > > > Thanks for your feedback, > > Ian Macfarlane > |