Here you can find the source of getElements(Element aElement)
Parameter | Description |
---|---|
aElement | a parameter |
public static List<Element> getElements(Element aElement)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 www.isandlatech.com (www.isandlatech.com) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from ww w .ja va 2 s .co m*/ * ogattaz (isandlaTech) - initial API and implementation *******************************************************************************/ import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /** * @param aElement * @return */ public static List<Element> getElements(Element aElement) { if (aElement == null) { return null; } List<Element> wElmts = new ArrayList<Element>(); NodeList wList = aElement.getChildNodes(); for (int wI = 0; wI < wList.getLength(); wI++) { if (wList.item(wI).getNodeType() == Node.ELEMENT_NODE) { wElmts.add((Element) wList.item(wI)); } } return wElmts; } }