HTML::Element->right/->look_down lose, I need to walk the tree



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
.



Relevant Pages

  • Re: DUMP/OUTPUT strangeness
    ... > $ DUMP *.HTML ... > then X.X contains only the dump of the last file. ... Which version of VMS? ... Prev by Date: ...
    (comp.os.vms)
  • DUMP/OUTPUT strangeness
    ... $ DUMP *.HTML ... $ DUMP *.HTML/OUTPUT=X.X ... What am I missing? ... Prev by Date: ...
    (comp.os.vms)
  • Re: restore subdirectory from dump to new partition
    ... I keep a CVS tree updated instead, and can always restore from there. ... I would say that your point regarding using dump when something other would ... backups, but will have to use the -x option rather than the -r option and ... I've also taken to deleting the obj directories on a regular basis. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: How to draw on "Microsoft Web Browser" control?
    ... I am doing semantic analysis on the HTML DOM tree, ... Draw on existing elements doesn't change the structure of the html ... which is a subclass of CWnd. ...
    (microsoft.public.vc.mfc)
  • Re: FS: hardlinks on directories
    ... >> Quite a lot of software thinks that the file hierarchy is a tree, ... Any application that must scan the tree in a search. ... The filesystem repair utilitity insisted that "directory was ... A dump of the CVS filesystem ...
    (Linux-Kernel)