in reply to HTML::DOM traverse
If you're intent is to sanitize HTML submitted by your users, I'm don't think HTML::DOM (or any other module that constructs a tree from the HTML before doing anything else) is the right route.
If not, here's what you asked:
for my $img ( $dom_tree->getElementsByTagName('img') ) { $img->delete(); }
Untested. Assumes getElementsByTagName returns HTML::Element objects.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML::DOM traverse
by jai_dgl (Beadle) on Apr 14, 2008 at 15:55 UTC |