X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FHTML%2FElement%2FLibrary.pm;h=523c2111b8cc3987f0bf5a12000bf61dfd5666bd;hb=de64e3d92123bc55a18ce3829f9c95af6e51e994;hp=8f888b5c321384c8cc84a32c52563ff0e82602ce;hpb=67e78ff23a6eddb48860da18de89798a5e3f1efe;p=html-element-library.git diff --git a/lib/HTML/Element/Library.pm b/lib/HTML/Element/Library.pm index 8f888b5..523c211 100644 --- a/lib/HTML/Element/Library.pm +++ b/lib/HTML/Element/Library.pm @@ -24,7 +24,7 @@ our @EXPORT = qw(); -our $VERSION = '3.51'; +our $VERSION = '3.53'; # Preloaded methods go here. @@ -36,6 +36,33 @@ sub HTML::Element::siblings { $p->content_list; } +sub HTML::Element::passover { + my ($tree, $child_id) = @_; + + #warn "ARGS: my ($tree, $child)"; + + my $exodus = $tree->look_down(id => $child_id); + + my @s = HTML::Element::siblings($exodus); + + warn "sibling count", scalar @s; + warn "siblings", join ':', @s; + + for my $s (@s) { + warn "SIBLING: $s"; + warn "ref sib", ref $s; + next unless ref $s; + if ($s->attr('id') eq $child_id) { + ; + } else { + $s->delete; + } + } + + return $exodus; # Goodbye Egypt! http://en.wikipedia.org/wiki/Passover + +} + sub HTML::Element::sibdex { my $element = shift;