Hi, I have created XML file for a Blackberry application ,and I have used
root.getFirstChild().setNodeValue("ABCDE");
to set the node value.
An exception is thrown while adding node value.
What can be done?
PLease help.
Thanks in advance.
Hi, I have created XML file for a Blackberry application ,and I have used
root.getFirstChild().setNodeValue("ABCDE");
to set the node value.
An exception is thrown while adding node value.
What can be done?
PLease help.
Thanks in advance.
I suspect (in the absence) of any info, that the getFirstChild()
method is not returning what you think it is (a text node?), but rather something else. I would inspect the node returned (cast appropriately) and work from there.
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory .newDocumentBuilder(); document = documentBuilder.newDocument(); root = document.createElement("START"); document.appendChild(root);
//After this,I am trying to set the node value:
root.getFirstChild().setNodeValue("ABCDE");