W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 1999

Fwd: Traversing tree nodes

From: New 2Java <new2java@hotmail.com>
Date: Wed, 06 Oct 1999 16:17:38 GMT
Message-ID: <19991006161739.73458.qmail@hotmail.com>
To: html-tidy@w3.org
Hello,
I am having difficulty traversing the tree tidy.parse() generates.
I want to
skip contents of some elements. I have used
"content" and "next" variables of the Node object to traverse the
tree. But
they haven't been very useful when skipping contents. Here is an
example:
"<html>
<head>
</head>
<body>
<table>
<thead>
<tr><td>table 1 - header info.
</thead>
<tfoot>
<tr><td>table 1 - footer info.
</tfoot>
<tbody>
<tr><td>
<table><thead><tr><td></thead><tfoot><tr><td></tfoot><tbody><tr><td>Si
>this table</tbody></table>
<tr><td>Skip embedded table to this row.
</tbody>
</table>
</body>
</html>"

What would be the correct algorithm to traverse this tree to arrive
at "skip
embedded table to this row" row, regardless of the level of
embedded tables?
Thanx.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Received on Wednesday, 6 October 1999 12:18:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:42 GMT