xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Clark <an...@apache.org>
Subject Re: Fast Nodes
Date Thu, 13 Dec 2001 10:08:32 GMT
Tobias McNulty wrote:
> So basically there isn't anything I can do to extend Xerces other
> than going into the its source and creating a custom
> createNodeIterator function?

No, there's nothing stopping you from extending the Apache DOM
implementation. And you don't have to deal with all of the
Deferred* node types. For example:

  public class MyElement extends ElementImpl {
    public MyElement(DocumentImpl doc, String name) {
      super(doc, name);
    }
  }

  public class MyDocument extends DocumentImpl {
    public Element createElement(String name) {
      return new MyElement(this, name);
    }
  }

[NOTE: I didn't check this for errors.]

And then just set the document-class-name property on the parser 
so that it uses your document class for making the DOM nodes as 
it parses. But depending on what you want to do, you may have to 
be careful about what you override, etc.

> >help to try subclassing the "deferred" heirarchy. The truth is that xerces
> >implementations are so tightly dependent on the xerces framework that
> >extension is hardly worth the effort.

That's hardly accurate. But there is a little bit of complexity
introduced for the benefit of memory and runtime performance.
So either we are too simple and slow which people don't like;
or we're fast but too complex which people don't like. Oh well...

-- 
Andy Clark * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message