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

Sat, 03 Aug 2019 13:46:43 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 03 Aug 2019 13:46:43 +0200
changeset 7
686991ae6e2f
parent 0
38775db5fdf5
permissions
-rw-r--r--

add configureable make variables

/*
 * 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