posted 16 years ago
Hi ,
i am trying to retrive the first child node and want to put in Map. but its throwing me null pointer exception. How to get only the first child of the xml file.
Below is my code:
if (reqNode != null) {
Node nodeList1 = reqNode.getFirstChild();
if (nodeList1 != null) leftFrstMap.put(nodeList1.getAttributes().getNamedItem("label").getNodeValue(), nodeList1.getAttributes().getNamedItem("href").getNodeValue());
}