Lists Home |
Date Index |
----- Original Message -----
From: "Gavin Thomas Nicol" <firstname.lastname@example.org>
> > I am wondering why there is no API combining Push or Pull with DOM.
> > Most DOM parsers have an underlying event parser anyway.
> You could use a SAX filter if the DOM builder can take SAX as input.
Well, that is what I usually do - using a SAX parser
and building an application specific object hierarchy (not really DOM).
It would be convenient, however, if the API standardized this.
Example with some Pull API (pseudo-Pascal):
while Parser.NextNode do
Node := Parser.Node;
case Node.Type of
if TElement(Node).Name = 'SomeName' then
Parser.KeepNode(Node); // this adds the node to the tree