In our HTML, we often have 3 cases of a header, where one tab is highlighted
based on the page... therefore we needed something more explicit than
highlander, so I wrote something that allows us to do:

    $tree->passover('reporting_header');

which would automatically delete the other candidate headers.

It's not on CPAN yet, but it is githubbed -
http://github.com/metaperl/html-element-library/tree/master

sub HTML::Element::passover {
  my ($tree, $child_id) = @_;

  my $exodus = $tree->look_down(id => $child_id);

  my @s = HTML::Element::siblings($exodus);

  for my $s (@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


}
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
seamstress-discuss mailing list
seamstress-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/seamstress-discuss

Reply via email to