OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] JITTs and DOM

[ Lists Home | Date Index | Thread Index ]


----- Original Message ----- 
From: "Gavin Thomas Nicol" <gtn@rbii.com>


> > 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):

...
Parser.Start;
while Parser.NextNode do
begin
  Node := Parser.Node;
  case Node.Type of
    ntElement:
    begin
      if TElement(Node).Name = 'SomeName' then
        Parser.KeepNode(Node);  // this adds the node to the tree
    end;
    ntAttribute: ...
    ntComment: ...
  end;
end;
...

Karl
  




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS