The actual overhead of keeping DOMNodes just as they are is about 4 bytes. A
Node only contain a pointer to a reference counted implementation of the
actual Node data. So you can feel free to keep nodes just as you like as
long as you do not allocate them on the heap (NO allocation of DOM objects).
Stick them in a vector, list, hash or whatever. Just make sure that you
release the node implementation by setting the cached nodes to 0 (yourNode =
0) to be able to drop documents from memory.

And of course some pseudo code (hey it is me remember) :)

doc = Load_document()
for_each_node_in(doc)
  if wanted(node)
    vector.push_back(node)
do_your_stuff_on(vector)
for_each_node_in(vector)
  node = 0 // Release node implementation
doc = 0 // Release document memory (if last handle to document)

Regards

Erik Rydgren
Mandarinen systems AB
Sweden

-----Original Message-----
From: Gerardo Fdez. [mailto:[EMAIL PROTECTED]]
Sent: den 28 november 2001 01:31
To: [EMAIL PROTECTED]
Subject: Direct access to nodes on a DOM tree


Hi!

My app needs access to so different and unsorted nodes of a DOM Tree,
i'm trying to get a way to keep info from each node (DOM_Node) to access
them directly whenever i need in my program saving this info in an array
or struct by example.

I'm new to Xerces and DOM and a bit confused about xerces api.

�any idea?


--

                                                   CU, Gerardo.




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