Reinier Post wrote:
> 1) how do I delete element attributes?
>
> There seems to be no way, except by breaking encapsulation, to remove
I just noticed that, too; very odd! The new HTML-Tree dist (0.65,
racing toward a CPAN mirror near you) fixes this:
$element->attr($thing, undef) deletes the attribute:
use HTML::Element 1.53;
my $x = HTML::Element->new('span');
$x->attr('foo', 123);
print map("<$_>", $x->all_attr), "\n";
#prints: <_tag><span><foo><123>
$x->attr('foo', '');
print map("<$_>", $x->all_attr), "\n";
#prints: <_tag><span><foo><>
$x->attr('foo', undef);
print map("<$_>", $x->all_attr), "\n";
#prints: <_tag><span>
> 2) how do I modify a tree while traversing it?
You don't. You make notes on what changes need to be made, then make
them right after the traversal.
> 3) what's the matter with framesets?
>
> <frameset>s are wrapped within <body>, which causes framed pages
> to turn up empty, at least in my version of Netscape.
>
> Why does this happen? Is it a design decision or just an byproduct
> of the implementation? (I haven't worked around this yet.)
It's not an inherent part of the implementation, but is sort of a side
effect of something else (namely the fact that things to stick in the
HTML tree are either things that appear in HEAD or things that appear
in BODY -- I haven't yet hacked in a special exception for the framey
tags).
In short, it's a side effect that I haven't bothered to go looking for
a workaround for, yet, since so far no-one really complained about it.
But it's always bothered me, and so now I'll think about how to get it
to work right.
--
Sean M. Burke [EMAIL PROTECTED] http://www.netadventure.net/~sburke/