[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Attaching information with each Node

  • To: xml-dev@l...
  • Subject: Attaching information with each Node
  • From: Ramkumar Menon <ram.menon@o...>
  • Date: Sat, 27 Sep 2003 13:25:51 +0530
  • Organization: Oracle India Private Ltd
  • User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01

for each node
Hi,

My application is creating a DOM tree from a set of Nodes passed to it, 
one after another, at Runtime.Later, I would persist the tree to the 
database.
While I am recieving the nodes, I need to have some information attached 
with each of them for some processing. There are two ways I know of 
doing this.
1) Decorate the Node with an attribute that holds the information
2) Use the setProperty() method that holds the information.

If I am going with (1) ,then after I do the required processing, and 
before I persist the constructed DOM tree out of these nodes, I need to 
undecorate the tree . (i.e. remove the attributes, since the persisted 
tree should not have these temporary attributes. Also this post 
processing is expensive.
If I am going with (2), I find that the setProperty() implementation is 
a bit expensive too.

i.e.  for e.g.

For (1) for a node <employee>, the decorated node will be <employee 
custAttr="1">. Then based on this attribute, some processing is done. 
Later as a part of post processing the attribute is removed from the node.
For (2), for a node <employee> I would do 
employeeNode.setProperty("custAttr","1"); These would not appear in the 
persisted XMLValue. But again, this is expensive from profiling results.

Is there any othe more performing way of doing this ?
Any help will be appreciated.

thanks,
Ram.
-- 
Ramkumar Menon,
Oracle India Pvt Ltd,
No:3, Bannerghatta Road,
Bangalore - 82,
India.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.