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

Re: Traversing tree nodes

From: Andy Quick <ac.quick@sympatico.ca>
Date: Wed, 6 Oct 1999 23:43:53 -0400
Message-ID: <001301bf1076$586a2580$9efbacce@quick>
To: <html-tidy@w3.org>
> I am having difficulty traversing the tree tidy.parse() generates. I want
> skip contents of some elements. I have used
> "content" and "next" variables of the Node object to traverse the tree.
> they haven't been very useful when skipping contents. Here is an example:

I suggest that you get the latest Java tidy with DOM interfaces.
The method names such as 'getChildNodes' make the relationships
more clear.  The Java tidy web page has an updated sample that uses
the DOM interfaces, as returned by parseDOM().

In the following HTML file (with missing end tags added) the embedded
table will be a child of one of the td elements:

<tr><td>table 1 - header info.
<tr><td>table 1 - footer info.
this table</td></tr></tbody></table>
<tr><td>Skip embedded table to this row.

Andy Quick
Received on Wednesday, 6 October 1999 23:45:47 UTC

This archive was generated by hypermail 2.3.1 : Friday, 13 July 2018 08:58:57 UTC