You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Martin Fanta <mf...@praxisxml.com> on 2000/09/18 15:11:56 UTC

SAX2DOM

Hi all,

I have a somewhat stupid question. I need a class
which is an extension of DefaultHandler and is
able to build a DOM by processing SAX events
and after that is able to return a Document.

Something like this:

class DOMBuildingHandler extends DefaultHandler
{
  ...
  void parse();
  Document getDocument();
  ...
}

Is there some class which does something at least
similar?

Thanks in advance
Martin

Re: SAX2DOM

Posted by Edwin Goei <Ed...@eng.sun.com>.
Martin Fanta wrote:
> 
> Hi all,
> 
> I have a somewhat stupid question. I need a class
> which is an extension of DefaultHandler and is
> able to build a DOM by processing SAX events
> and after that is able to return a Document.
> 
> Something like this:
> 
> class DOMBuildingHandler extends DefaultHandler
> {
>   ...
>   void parse();
>   Document getDocument();
>   ...
> }
> 
> Is there some class which does something at least
> similar?

There is a class in the Crimson parser that does this.  See
org.apache.crimson.tree.XmlDocumentBuilder.java.  Crimson is in the
/xml-contrib repository currently.

-Edwin