Originally posted by William Brogden:
What exactly are you trying to accomplish by setting the property to null?
Originally posted by Paul Clapham:
In your case, after this line of code Element element = doc.getElementById("studid"); is executed, the "element" variable is null. That's because you made the common mistake of assuming that the getElementById() method looks for elements that have an attribute whose name is "id". It doesn't. It looks for elements that have an attribute that is defined, by a DTD or a schema, to be an "ID" attribute.