• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

beginner DOM iteration problem

 
kalle svensson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, all ranchers!
My question is if there is any one here who can see what i am doing wrong with the current code sample. I have done this before but i cant
get it right this time. Is there anyone here that can help me to see what i am doing wrong? I would be very greatful for any hint or tip posted here.
My problem is that i must store values from a xml file in a array of String objects but i keep getting null values when i print out the array in
question. Here is my code so far.

Here is the beginning of the java code for the question in mind ...

And this is where i always get stuck. I keep getting null values in my contacts array when I am looping through it. I know there must be a lot of errors in my java code
but i am a complete rookie with so far only basic knowledges. I cant see why null values are stored in the contacts array? Can anyone explain what i am doing wrong and the origin of
the null values. Any hint or tip will be very much appreciated.
 
Paul Clapham
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starting at line 21 you set four variables to null.

Then from lines 26 to 40 you have some code which can change at most one of those variables. So at least three of them must still be null after line 40.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic