HTML::Element->right/->look_down lose, I need to walk the tree
- From: Roderick Schertler <roderick@xxxxxxxxx>
- Date: 20 Jun 2005 08:56:54 -0400
Consider this HTML::Element dump of a simple HTML page:
<html> @0
<head> @0.0
<title> @0.0.0
"HTML::Element test"
<body> @0.1
<div> @0.1.0
<h1> @0.1.0.0
"heading"
<p> @0.1.1
"paragraph"
I've got to find the <p> after first searching for the <h1>. Because of
the <div> I can't use $h1->right. My first thought was to start from
$h1->pindex in $h1->parent->content_list, but this would fail if there
were even more levels between the two.
I really need to continue a walk of the tree, starting at h1. I can't
find an HTML::Element method which does that. It is an easy enough
iterator to write, but it seems so basic a need that I figure it's there and
I'm missing it. Is it?
It also seems to me that there should be something like ->look_down
(->look_next?) which does a search like this, for the same reason.
--
Roderick Schertler
roderick@xxxxxxxxx
.
- Prev by Date: Re: SGI::FAM and File::PathConvert
- Next by Date: Can't locate object method "blocking" via package "IO::Handle"
- Previous by thread: Perl under MS IIS with access to MySQL
- Next by thread: Can't locate object method "blocking" via package "IO::Handle"
- Index(es):
Relevant Pages
|