Thread: [Htmlparser-user] Parser once, and filter more tags
Brought to you by:
derrickoswald
From: 丛林 <con...@gm...> - 2011-05-01 02:56:36
|
Hi, I am a freshman in htmlparser area. My problem is: If I want to filter many tags, how can I complete it during one parser with out reset this parser? For example: NodeFilter A = new TagNameFilter("A"); NodeList a = new NodeList(); NodeFilter B = new TagNameFilter("B"); NodeList b = new NodeList(); Now, I have to fetch a and b with parser during two times: a = Parser.parser(A); Parser.reset(); b = Parser.parser(B); Can I complete these once? [a, b] = Parser.parser(A, B); As you know, another Parser will consume more resourse. Thanks for your help :-) Best Wishes, -LIn |
From: Derrick O. <der...@gm...> - 2011-05-06 19:26:34
|
Depending on what you want to do with the nodes, you should be able to get both in one pass with an OR filter: NodeFilter x = new OrFilter (A, B); This will give one list with both node types and you'll have to handle that in the subsequent processing. On Sun, May 1, 2011 at 4:56 AM, 丛林 <con...@gm...> wrote: > Hi, I am a freshman in htmlparser area. > > My problem is: > If I want to filter many tags, how can I complete it during one parser > with out reset this parser? > > For example: > NodeFilter A = new TagNameFilter("A"); > NodeList a = new NodeList(); > > NodeFilter B = new TagNameFilter("B"); > NodeList b = new NodeList(); > > Now, I have to fetch a and b with parser during two times: > > a = Parser.parser(A); > Parser.reset(); > b = Parser.parser(B); > > Can I complete these once? > [a, b] = Parser.parser(A, B); > As you know, another Parser will consume more resourse. > > > Thanks for your help :-) > > Best Wishes, > > -LIn > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > |
From: 丛林 <con...@gm...> - 2011-05-07 00:55:46
|
Dear Oswald, As you say, if we use OrFilter, the filtered result is mixed with many node types. I think the subsequent processing is more complex and more fallible, such as regex, matching and so on Is there any Function as, nodelist[] {NA, NB} = FUNCTION(Filter[] {FA, FB}) or is there any easy subsequent processing? Best Wishes, -Lin 2011/5/7 Derrick Oswald <der...@gm...>: > Depending on what you want to do with the nodes, you should be able to get > both in one pass with an OR filter: > NodeFilter x = new OrFilter (A, B); > This will give one list with both node types and you'll have to handle that > in the subsequent processing. > > On Sun, May 1, 2011 at 4:56 AM, 丛林 <con...@gm...> wrote: >> >> Hi, I am a freshman in htmlparser area. >> >> My problem is: >> If I want to filter many tags, how can I complete it during one parser >> with out reset this parser? >> >> For example: >> NodeFilter A = new TagNameFilter("A"); >> NodeList a = new NodeList(); >> >> NodeFilter B = new TagNameFilter("B"); >> NodeList b = new NodeList(); >> >> Now, I have to fetch a and b with parser during two times: >> >> a = Parser.parser(A); >> Parser.reset(); >> b = Parser.parser(B); >> >> Can I complete these once? >> [a, b] = Parser.parser(A, B); >> As you know, another Parser will consume more resourse. >> >> >> Thanks for your help :-) >> >> Best Wishes, >> >> -LIn >> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> Htmlparser-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > |