src/main/java/de/unixwork/uwproj/Xml.java

changeset 0
38775db5fdf5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/unixwork/uwproj/Xml.java	Mon Feb 04 15:09:39 2019 +0100
@@ -0,0 +1,27 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package de.unixwork.uwproj;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @author olaf
+ */
+public class Xml {
+    public static String getContent(Element elm) {
+        NodeList nodes = elm.getChildNodes();
+        for(int i=0;i<nodes.getLength();i++) {
+            Node node = nodes.item(i);
+            if (node.getNodeType() == Node.TEXT_NODE) {
+                return node.getTextContent();
+            }
+        }
+        return null;
+    }
+}

mercurial