Thread: RE: [Htmlparser-developer] Registering of scanners
Brought to you by:
derrickoswald
|
From: <dha...@or...> - 2003-05-08 03:55:57
Attachments:
BDY.RTF
|
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 > > > > ------------------------------------------------------- Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com _______________________________________________ Htmlparser-developer mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-developer |
|
From: <dha...@or...> - 2003-05-09 03:37:51
Attachments:
BDY.RTF
|
Derrick, the same problem then exists with the FormTag. Even if Input
tag is registered explicitly (as well as inside the FormScanner), tags
of type InputTag are not retrieved. I'll file a bug report for the same.
Related to the string filters I also have one issue. Ideally there
should be a contract for all the constructors of children of Tag class.
Currently we see different types of constructors in the different tags.
When I started out using the HTMLParser, this string filter totally
confused me. I was gicing some random input, I did'nt know y, did'nt
know where it was used and did'nt really see any benefit. Hence I
bel;ieve the no-arg constructor is a must for easy usage in all Tags.
Regards,
Dhaval Udani
Senior Analyst
M-Line, QPEG
OrbiTech Solutions Ltd.
+91-22-28290019 Extn. 1457
-----Original Message-----
From: DerrickOswald [mailto:Der...@ro...]
Sent: Thursday, May 08, 2003 5:22 PM
To: htmlparser-developer
Cc: DerrickOswald
Subject: Re: [Htmlparser-developer] Registering of scanners
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
>>
>>
>>
>>
>>
>>
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
_______________________________________________
Htmlparser-developer mailing list
Htm...@li...
https://lists.sourceforge.net/lists/listinfo/htmlparser-developer
|
|
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
>>
>>
>>
>>
>>
>>
|