Thread: Re: [Htmlparser-user] how to get a node struture with particular attribute
Brought to you by:
derrickoswald
From: Derrick O. <der...@ro...> - 2008-05-23 21:28:00
|
The HtmlParser doesn't come with a Font tag that is composite. If you want this behaviour you need to define your own tag as described here: http://htmlparser.sourceforge.net/faq.html#composite ----- Original Message ---- From: answers solutions <fas...@gm...> To: htm...@li... Sent: Friday, May 23, 2008 4:59:54 AM Subject: [Htmlparser-user] how to get a node struture with particular attribute hi i am filter like this NodeFilter filterClass = new AndFilter(new TagNameFilter("font"),new HasAttributeFilter("class","leftnavi")); I am using this filter aginst this Text <FONT class=leftnavi size=2> <a href="http://epaper.thehindu.com">ePaper</a><br> <A href="01hdline.htm">Front Page</A><BR> <A href="02hdline.htm">National</A><BR> <font class=leftnavi color=black>States:</font><br> • <A href="23hdline.htm">Tamil Nadu</A><BR> • <A href="21hdline.htm">Andhra Pradesh</A><BR> • <A href="22hdline.htm">Karnataka</A><BR> • <A href="25hdline.htm">Kerala</A><BR> • <A href="24hdline.htm">New Delhi</A><BR> • <A href="14hdline.htm">Other States</A><BR> <A href="03hdline.htm">International</A><BR> <A href="05hdline.htm">Opinion</A><BR> <A href="06hdline.htm">Business</A><BR> <A href="07hdline.htm">Sport</A><BR> <A href="10hdline.htm">Miscellaneous</A><BR> • <A href="10hdline.htm#019">Cartoons</A><BR> <A href="26hdline.htm">Engagements</A><BR> </FONT> but the i am getting is <FONT class=leftnavi size=2> but i want o/p as whole font tag as <FONT class=leftnavi size=2> <a href="http://epaper.thehindu.com">ePaper</a><br> <A href="01hdline.htm">Front Page</A><BR> <A href="02hdline.htm">National</A><BR> <font class=leftnavi color=black>States:</font><br> • <A href="23hdline.htm">Tamil Nadu</A><BR> • <A href="21hdline.htm">Andhra Pradesh</A><BR> • <A href="22hdline.htm">Karnataka</A><BR> • <A href="25hdline.htm">Kerala</A><BR> • <A href="24hdline.htm">New Delhi</A><BR> • <A href="14hdline.htm">Other States</A><BR> <A href="03hdline.htm">International</A><BR> <A href="05hdline.htm">Opinion</A><BR> <A href="06hdline.htm">Business</A><BR> <A href="07hdline.htm">Sport</A><BR> <A href="10hdline.htm">Miscellaneous</A><BR> • <A href="10hdline.htm#019">Cartoons</A><BR> <A href="26hdline.htm">Engagements</A><BR> </FONT> |
From: answers s. <fas...@gm...> - 2008-05-26 09:15:16
|
hi i am the same behaviour for div tag also i am using like this NodeFilter filterStyleClass = new HasAttributeFilter("class",(String)list.get(j)); NodeList listStyleClass=parse.extractAllNodesThatMatch(filterStyleClass); i want extract a div tag with attribute "class" and also the childTags inside tht DivTag On 5/24/08, Derrick Oswald <der...@ro...> wrote: > > The HtmlParser doesn't come with a Font tag that is composite. > If you want this behaviour you need to define your own tag as described > here: http://htmlparser.sourceforge.net/faq.html#composite > > ----- Original Message ---- > From: answers solutions <fas...@gm...> > To: htm...@li... > Sent: Friday, May 23, 2008 4:59:54 AM > Subject: [Htmlparser-user] how to get a node struture with particular > attribute > > hi > > i am filter like this > > > NodeFilter filterClass = new AndFilter(new TagNameFilter("font"),new > HasAttributeFilter("class","leftnavi")); > > > > I am using this filter aginst this Text > > <FONT class=leftnavi size=2> > <a href="http://epaper.thehindu.com">ePaper</a><br<http://epaper.thehindu.com%22%3eepaper%3c/a%3E%3Cbr> > > > <A href="01hdline.htm">Front Page</A><BR> > <A href="02hdline.htm">National</A><BR> > <font class=leftnavi color=black>States:</font><br> > • <A href="23hdline.htm">Tamil Nadu</A><BR> > • <A href="21hdline.htm">Andhra Pradesh</A><BR> > • <A href="22hdline.htm">Karnataka</A><BR> > • <A href="25hdline.htm">Kerala</A><BR> > • <A href="24hdline.htm">New Delhi</A><BR> > • <A href="14hdline.htm">Other States</A><BR> > <A href="03hdline.htm">International</A><BR> > <A href="05hdline.htm">Opinion</A><BR> > <A href="06hdline.htm">Business</A><BR> > <A href="07hdline.htm">Sport</A><BR> > <A href="10hdline.htm">Miscellaneous</A><BR> > • <A href="10hdline.htm#019">Cartoons</A><BR> > <A href="26hdline.htm">Engagements</A><BR> > </FONT> > > > but the i am getting is <FONT class=leftnavi size=2> > > > but i want o/p as whole font tag as > > <FONT class=leftnavi size=2> > <a href="http://epaper.thehindu.com">ePaper</a><br<http://epaper.thehindu.com%22%3eepaper%3c/a%3E%3Cbr> > > > <A href="01hdline.htm">Front Page</A><BR> > <A href="02hdline.htm">National</A><BR> > <font class=leftnavi color=black>States:</font><br> > • <A href="23hdline.htm">Tamil Nadu</A><BR> > • <A href="21hdline.htm">Andhra Pradesh</A><BR> > • <A href="22hdline.htm">Karnataka</A><BR> > • <A href="25hdline.htm">Kerala</A><BR> > • <A href="24hdline.htm">New Delhi</A><BR> > • <A href="14hdline.htm">Other States</A><BR> > <A href="03hdline.htm">International</A><BR> > <A href="05hdline.htm">Opinion</A><BR> > <A href="06hdline.htm">Business</A><BR> > <A href="07hdline.htm">Sport</A><BR> > <A href="10hdline.htm">Miscellaneous</A><BR> > • <A href="10hdline.htm#019">Cartoons</A><BR> > <A href="26hdline.htm">Engagements</A><BR> > </FONT> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > |