/** * Find the first direct child with a given attribute. * * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Element findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Element child = (Element)getChild(parent, Node.ELEMENT_NODE); if (attVal == null) { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && DOMUtils.getAttribute(child, attName) != null) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } else { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && !attVal.equals(DOMUtils.getAttribute(child, attName))) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } return child; }
/** * Find the first direct child with a given attribute. * * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Element findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Element child = (Element)getChild(parent, Node.ELEMENT_NODE); if (attVal == null) { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && DOMUtils.getAttribute(child, attName) != null) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } else { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && !attVal.equals(DOMUtils.getAttribute(child, attName))) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } return child; }
/** * Find the first direct child with a given attribute. * * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Element findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Element child = (Element)getChild(parent, Node.ELEMENT_NODE); if (attVal == null) { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && DOMUtils.getAttribute(child, attName) != null) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } else { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && !attVal.equals(DOMUtils.getAttribute(child, attName))) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } return child; }
/** * Find the first direct child with a given attribute. * * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Element findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Element child = (Element)getChild(parent, Node.ELEMENT_NODE); if (attVal == null) { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && DOMUtils.getAttribute(child, attName) != null) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } else { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && !attVal.equals(DOMUtils.getAttribute(child, attName))) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } return child; }
/** * Find the first direct child with a given attribute. * * @param parent * @param elemName name of the element, or null for any * @param attName attribute we're looking for * @param attVal attribute value or null if we just want any */ public static Element findChildWithAtt(Node parent, String elemName, String attName, String attVal) { Element child = (Element)getChild(parent, Node.ELEMENT_NODE); if (attVal == null) { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && DOMUtils.getAttribute(child, attName) != null) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } else { while (child != null && (elemName == null || elemName.equals(child.getNodeName())) && !attVal.equals(DOMUtils.getAttribute(child, attName))) { child = (Element)getNext(child, elemName, Node.ELEMENT_NODE); } } return child; }
Node parentNode = include.getParentNode(); parentNode.removeChild(include); String cid = DOMUtils.getAttribute(include, "href");
Node parentNode = include.getParentNode(); parentNode.removeChild(include); String cid = DOMUtils.getAttribute(include, "href");
Node parentNode = include.getParentNode(); parentNode.removeChild(include); String cid = DOMUtils.getAttribute(include, "href");
Node parentNode = include.getParentNode(); parentNode.removeChild(include); String cid = DOMUtils.getAttribute(include, "href");