Attaching values to DOM tree nodes
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Max_Tay
Posted On:   Friday, June 14, 2002 08:34 AM

Hi there i m trying to attach some values, such as node_order,node_depth and node_size, to each and every node in the DOM tree i parsed. The reason being those values are to be stored in RDBMS together with the nodes' name etc. The problem is that i couldn't extend or implement those nodes to allow me to add additional values other than those already defined. As the node_size for each node has to be calculated from previous sibling and parent, i will need to store those values directly onto the nodes. After which normal dom traversal will allow me to calculate the correct node_size for each nodes. pls let me know if there is another way to accomplish my objectives. thank you Max    More>>

Hi there

i m trying to attach some values, such as node_order,node_depth and node_size, to each and every node in the DOM tree i parsed.
The reason being those values are to be stored in RDBMS together with the nodes' name etc.

The problem is that i couldn't extend or implement those nodes to allow me to add additional values other than those already defined.

As the node_size for each node has to be calculated from previous sibling and parent, i will need to store those values directly onto the nodes. After which normal dom traversal will allow me to calculate the correct node_size for each nodes.

pls let me know if there is another way to accomplish my objectives.

thank you
Max

   <<Less

Re: Attaching values to DOM tree nodes

Posted By:   Roseanne_Zhang  
Posted On:   Thursday, September 5, 2002 07:08 AM

I believe that you have already found out how to modify your xml document, since it is not as hard as you first looked.



However, out of curious, what is your definition of node_size and node_order mean? From your decription, it seems obscure to me. Why a node size has anything to do with its perent/siblings?



If you have time, give me a little explanation. I'm a graph theory lady. XML tree is just a non-cyclic direct graph to me, even we are not using edge concept in xml parsing. My guessing is your definition might illustrate something.


Thanks in advance!

Re: Attaching values to DOM tree nodes

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, June 14, 2002 10:51 AM

Construct a parallel DOM tree, with the same structure as the original one, but where you CAN extend/implement the nodes with your own attributes?

About | Sitemap | Contact