[jdom-interest] Null Pointer Exception from getTextTrim() method
Victor Toni
victor.toni at ebuconnect.de
Thu Jun 23 03:40:08 PDT 2005
Maybe you should take a closer look at the names of your variables.
Usually one would use some breakpoints, logging messages, etc. before
saying something like:
My loop doesn't work with JDOM.
Here is my code snippet:
while(false) {
// some JDOM stuff
}
Anand, Rajesh wrote:
> Folks,
>
> here is my code snippet....
>
> * Line1 - Element childelem2 = element.getChild("ClosingPrice",
> element.getNamespace());*
> * *
> * Line 2 -String date[x] = childelem1.getTextTrim();*
>
> and here is the part of XML I'm trying to read...
>
> * <getIndex:Price> *
> *
> <getIndex:PriceEffectiveDate>2005-05-10</getIndex:PriceEffectiveDate> *
> * <getIndex:ClosingPrice>2.99</getIndex:ClosingPrice> *
> * </getIndex:Price>*
>
> So, why is the 2nd line giving me Null Pointer error instead
> of returning a value of "2.99"??
>
> Any helps will be greatly appreciated.
>
> */Rajesh Anand/*
> *Email:Rajesh_anand at ml.com*
>
> ------------------------------------------------------------------------
> If you are not an intended recipient of this e-mail, please notify the
> sender, delete it and do not read, act upon, print, disclose, copy,
> retain or redistribute it. Click here
> <http://www.ml.com/email_terms/>for important additional terms
> relating to this e-mail. http://www.ml.com/email_terms/
> ------------------------------------------------------------------------
>
>------------------------------------------------------------------------
>
>_______________________________________________
>To control your jdom-interest membership:
>http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20050623/c0d4426e/attachment.htm
More information about the jdom-interest
mailing list