Re: [Htmlparser-developer] Registering of scanners
Brought to you by:
derrickoswald
|
From: Derrick O. <Der...@ro...> - 2003-05-08 11:37:22
|
You should get back explicit tags (not generic org.htmlparser.tags.Tag
objects) for each scanner you register.
If not, it's a bug.
On another topic, I have noticed a problem with string filters.
Scanners register with a filter string like:
parser.addScanner(new InputTagScanner("-i"));
or
addScanner(linkScanner.createImageScanner(ImageTag.IMAGE_TAG_FILTER));
By the way, both of these are "-i".
Since the filters are compared with == rather than a string comparison,
you would have to get the filter from the scanner itself for collectInto
to work:
x = new InputTagScanner("-i");
parser.addScanner(x);
...
div.collectInto(nodeList,x.getFilter());
It looks like collectInto(NodeList, String) needs fixing and
collectInto(NodeList, Class) is the way to go.
Maybe we should deprecate the former.
Derrick
dha...@or... wrote:
>INPUT tag is found as a tag. No problem with that. However if the
>InputTagScanner is also registered then a class of type
>org.htmlparser.tags.InputTag is not found.
>
>I am not too sure about the expected behaviour and hence do not know
>whether its a bug or not. Do let me know what to do.
>
>dhaval
>
>
>-----Original Message-----
>From: DerrickOswald [mailto:Der...@ro...]
>Sent: Thursday, May 08, 2003 7:03 AM
>To: htmlparser-developer
>Cc: DerrickOswald
>Subject: Re: [Htmlparser-developer] Registering of scanners
>
>
>Dahval,
>
>DIV is a CompositeTag.
>Are you saying the INPUT tag isn't one of the children of the DIV tag.
>If that's the case file a bug report.
>
>Derrick
>
>dha...@or... wrote:
>
>
>
>>In the HTMLParser version of 27th April I believe registering of Div
>>Scanner and Table scanner was added to the automatic list i.e via
>>Parser.registerScanners().
>>
>>Due to this I am unable to recognize any of the tags underneath the DIV
>>tag.
>>
>>For example I had INPUT tag underneath the DIV tag. I used
>>registerScanners and I also registered InputTagScanner. However I could
>>detect DIV tags but not INPUT tags.
>>
>>Regards,
>>
>>Dhaval Udani
>>Senior Analyst
>>M-Line, QPEG
>>OrbiTech Solutions Ltd.
>>+91-22-28290019 Extn. 1457
>>
>>
>>
>>
>>
>>
|