I do not know how you intend to use the getAttribute fn in your application. But just 
a tip.

each call to getAttribute (when u want to get attrib by name) causes many 
searches/traversals/string-comparisons etc to happen. Internally, the implementation 
uses binary search, but still, multiple string comparisons are involved.

It is my opinion that if you already know the names of your attributes, it would be 
more efficient to just walk the attribute list ONCE and keep picking out the 
attributes you encounter.

Let us say you expect a dozen attribs like : "attrib1"..."attrib12". Then, instead of 
making a dozen calls to getAttribute("attribn") will be less efficient than just 
getting the list of attributes, walking through each of them and processing each 
attribute as they are encountered...

The point is that once you get and process attrib1, it makes no sense to compare with 
this attrib again when you want to get attrib2...

just my two cents.

-Vinayak

> -----Original Message-----
> From: Andreas B. Thun [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 11:31 AM
> To: [EMAIL PROTECTED]
> Subject: Re: parsing DOM tree: How to get attribute values ( I don�t
> like mondays)
> 
> 
> > wow ! we are all really very glad that it worked for you :-)
> 
> please do not put me in the mail filter already!  :)
> 
> 
> ---------------------------------------------------------------------
> 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