Re: [Htmlparser-user] pre tag
Brought to you by:
derrickoswald
From: Derrick O. <Der...@Ro...> - 2006-11-04 21:52:20
|
Dave, PRE has not been added as a tag because it very often is not closed by the /PRE. You can create your own "PRE" tag class derived from CompositeTag, and register it with a PrototypicalNodeFactory you give to the parser. To answer your previous question about filters for: <div>Good Morning</div> <h3>Description</h3> <pre> *Text to extract Line1* *Text to extract Line2* </pre> <div>Good Morning</div> ... find the H3 node (with Description as the contents), ... get it's parent ... and extract all text from the parent's children (after the Heading) so it would be something like ExtractTextFromChildrenOf (HasSibling (And (TagName(H3), HasChild (String(Description))))) This is a lot easier to construct with the FilterBuilder application. ... or alternatively I had thought of making a 'TriggerFilter' that would set a member flag when it's subordinate filter went true, and after that would always return true because the flag was set... but then this member would need to be reset or you would need to build the filter fresh for each parse. Derrick Dave wrote: > <pre> > text1 > </pre> > > <table> > <tr><td>text2</td><tr> > </table> > > >parse http://web-site table > show the whole table structure > >parse http://web-site <http://web-site/> pre > show the tag "pre" only, no text inside the pre tag. > > It seems that pre is not treated as the parent node of "text1". > > Is this a bug? > > Thanks! > > > > |