import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class Utils {
/**
* Get the first child element
* @param parent
* @return
*/
public static Element getFirstChildElement(Node parent) {
NodeList childs = parent.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Node child = childs.item(i);
if (child instanceof Element) {
return (Element) child;
}
}
return null;
}
}
sources68 the directory containing the programming examples, source code and programming guide online
Friday, 5 August 2011
Get the first child element
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment