W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

RE: nullpointer : very important abnormality

From: Andrew Anand <anand.andrew@fedex.com>
Date: Mon, 3 Dec 2001 17:38:36 -0600
To: <keshlam@us.ibm.com>, "Americo Albuquerque" <chainsword@altavista.com>
Cc: "andrewfdx" <anand.andrew@fedex.com>, <www-dom@w3.org>
Message-ID: <JBEPLAFFGEKDEAPHMEGFCENHCDAA.anand.andrew@fedex.com>
I have a similar situation.
I can retrieve the value of element(p) using
document.getElementsByTagName("p").

I can parse my XML using xerces DOMParser and retrieve the element value.
If my XML is based on a DTD which contains more than 2 child dtds, still i
can successfully parse the XML and retrieve the element value using
 document.getElementsByTagName("p")  ONLY some indefinite number of times
before my applcation hangs. After this point I can still parse the xml but
invoking the
same method document.getElementsByTagName("p") results in NULL POINTER
EXCEPTION.

Could you please elaborate on this aspect as soon as you can.
I think this is very abnormal behaviour for the DOM(document ) methods to
work for an indefinite amount of time.
System crashes after running normally for an  indefinite amount of time,
even with case of XML based on dtd containing 3 child dtds.

Would you please elaborate on this aspect as soon as you get a chance,

thanks,
Andrew



-----Original Message-----
From: www-dom-request@w3.org [mailto:www-dom-request@w3.org]On Behalf Of
Americo Albuquerque
Sent: Friday, June 01, 2001 5:52 AM
To: keshlam@us.ibm.com
Cc: www-dom@w3.org
Subject: Re: nullpointer


On Thu, 31 May 2001, "Joseph Kesselman" wrote:

>
>
> >x.setStart(document.getElementsByTagName("p")[0],0);
You have to check if element document.getElementsByTagName("p") exists or it
will crash when you try to get document.getElementsByTagName("p")[0] since
you can not get an array value from a null pointer.

> >x.insertNode(document.getElementsByTagName("div")[0]);
the same applies to document.getElementsByTagName("div")


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com
Received on Monday, 3 December 2001 18:39:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:55 GMT