[Htmlparser-developer] Obtaining siblings of root-level nodes
Brought to you by:
derrickoswald
From: Ian M. <ian...@gm...> - 2005-11-01 16:04:49
|
There doesn't seem to be any way of traversing from one top level node (e.g. doctype, html, #text, etc) to any of its siblings, once you no longer have the original NodeList obtained from the Parser class. This means, for example, that you cannot do a get previous/next sibling method currently on these nodes. A few quick ideas about how to do this (none of which are particularly idea= l): - Create a node named something like DocumentNode (we have HTMLPage but that doesn't really seem to do what we want) that whose children are the NodeList obtained by the Parser class. Make the Parser class create one of these instead of the NodeList as it does now. - Have a method named something like getDocument for each tag, which simply returns a reference to the initial NodeList obtained by the Parser class. Any other ideas are welcome. Ian |