aboutsummaryrefslogtreecommitdiff
path: root/common/src/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/at/gv')
-rw-r--r--common/src/at/gv/egovernment/moa/util/DOMUtils.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/DOMUtils.java b/common/src/at/gv/egovernment/moa/util/DOMUtils.java
index 52f6554d5..fddf16944 100644
--- a/common/src/at/gv/egovernment/moa/util/DOMUtils.java
+++ b/common/src/at/gv/egovernment/moa/util/DOMUtils.java
@@ -7,8 +7,10 @@ import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Vector;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -854,5 +856,26 @@ public class DOMUtils {
}
return null;
}
+
+ /**
+ * Returns all child elements of the given element.
+ *
+ * @param parent The element to get the child elements from.
+ *
+ * @return A list including all child elements of the given element.
+ * Maybe empty if the parent element has no child elements.
+ */
+ public static List getChildElements (Element parent) {
+ Vector v = new Vector();
+ NodeList nl = parent.getChildNodes();
+ int length = nl.getLength();
+ for (int i=0; i < length; i++) {
+ Node node = nl.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ v.add((Element)node);
+ }
+ }
+ return v;
+ }
}