Hi!
I use XPathOperations on a Source with this code:
This codeCode:xpathOperator.evaluateAsObject("ns1:Capabs/pls:ServiceId",src, new NodeMapper() { public Object mapNode(Node node, int i) throws DOMException { Element servIdent = (Element) node; String type = new String(); try { System.err.println(servIdent.toString()); type = servIdent.getElementsByTagNameNS("pls","ServiceType").item(0).getNodeValue(); System.err.println("t1"); } catch (DOMException de) { System.err.println("t2"); de.printStackTrace(); } String version = servIdent.getElementsByTagNameNS("pls","ServiceTypeVersion").item(0).getNodeValue(); String title = servIdent.getElementsByTagNameNS("pls","Title").item(0).getNodeValue(); return new Capabilities(type, version, title); } });prints into the outputCode:System.err.println(servIdent.toString());and I get a NullPointerException on the lineCode:[pls:ServiceId : null]I've traced the problem inside JDK classes, where XPathImpl which is being used dwells. Apparently, Document is loaded with null siblings.Code:type = servIdent.getElementsByTagNameNS("pls","ServiceType").item(0).getNodeValue();
Does anyone have any idea?


Reply With Quote
