/** * Finds a Node with a given QNameb. * * @param node parent node * @param name QName of the child we need to find * @return Returns child node. */ public static Node findNode(Node node, QName name) { if (name.getNamespaceURI().equals(node.getNamespaceURI()) && name.getLocalPart().equals(node.getLocalName())) { return node; } NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node ret = findNode(children.item(i), name); if (ret != null) { return ret; } } return null; }
/** * Finds a Node with a given QNameb. * * @param node parent node * @param name QName of the child we need to find * @return Returns child node. */ public static Node findNode(Node node, QName name) { if (name.getNamespaceURI().equals(node.getNamespaceURI()) && name.getLocalPart().equals(node.getLocalName())) { return node; } NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node ret = findNode(children.item(i), name); if (ret != null) { return ret; } } return null; }