Yes, I've tried this too. It would very useful to be able to type elements
correctly in a java environment. It makes the handling easier and safer.
Unfortunately, the xerces implementations use a complex inheritance
structure for their elements. The "deferred Node" implementations allow DOM
nodes not to be fully expanded until they are required. The downside is that
casts between xerces elements and whatever subclasses of ElementImpl you
write will fail if that element has not been fully expanded. Nor will it
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.

Although I haven't really solved this problem to my satisfaction yet, it
might involve the containment of an org.w3c.dom type in a proxy of some
sort. That perhaps implies one proxy class for every element type you are
concerned with, and a graph of types matching a particular schema.

Alternatively, check out the tiny, elegant, fast NanoXml at
http://nanoxml.sourceforge.net/
No problems extending that.

-----Original Message-----
From: Tobias McNulty [mailto:[EMAIL PROTECTED]
Sent: Thursday, 13 December 2001 4:04 a.m.
To: [EMAIL PROTECTED]
Subject: Fast Nodes


I am trying to implement a custom Element class to speed access to
its children.  For example, I have a huge array of long ints, and it
would be very inefficient to store these all in their own Element
class as a true child.

So, I want to customize Element and provide functions that access the
array directly.  One possibility would be implementing the
NodeIterator interface to make nextNode() return the same node each
time, but increment an internal iterator in the parent Element so
that the next time the value of the Element is accessed, it returns
the next entry in the array.

I heard bits and pieces about "fast nodes" and "Deferred" classes.
Would these help under this situation?  What exactly are they/do they
do, and where can I find more information about them?  The only
documentation I found was very sparse.

Thanks in advance,

Toby
--
Tobias McNulty
Data Description, Inc.
840 Hanshaw Road, Suite 9
Ithaca, NY 14850
Phone: (607) 257-1000
E-mail: [EMAIL PROTECTED]
Web: www.datadesk.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to