in reply to Re: Using Perl to snip the end off of HTML
in thread Using Perl to snip the end off of HTML
BTW, while daydreaming, I thought of a "lateral solution". I know there are two classic means of parsing XML - stack based, reactive (SAX) and tree based, proactive (DOM). Couldn't a tree based module handle this easily:
pseudocode:
Voila! Any nesting would be irrelevant, since it wouldn't show up on the top level tree. Would this work? More importantly, is there a tree style HTML parser for Perl (the one I am familiar with is event based, tag based, and reactive)my $node = tree.getbodynode.getlasttoplevelnode delete tree.$node if ($node.type == blockquote) (recurse)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using Perl to snip the end off of HTML
by ww (Archbishop) on Jun 15, 2005 at 13:38 UTC | |
|
Re^3: Using Perl to snip the end off of HTML
by eastcoastcoder (Sexton) on Jun 17, 2005 at 04:49 UTC |