|
1 /* |
|
2 * To change this license header, choose License Headers in Project Properties. |
|
3 * To change this template file, choose Tools | Templates |
|
4 * and open the template in the editor. |
|
5 */ |
|
6 package de.unixwork.uwproj; |
|
7 |
|
8 import org.w3c.dom.Element; |
|
9 import org.w3c.dom.Node; |
|
10 import org.w3c.dom.NodeList; |
|
11 |
|
12 /** |
|
13 * |
|
14 * @author olaf |
|
15 */ |
|
16 public class Xml { |
|
17 public static String getContent(Element elm) { |
|
18 NodeList nodes = elm.getChildNodes(); |
|
19 for(int i=0;i<nodes.getLength();i++) { |
|
20 Node node = nodes.item(i); |
|
21 if (node.getNodeType() == Node.TEXT_NODE) { |
|
22 return node.getTextContent(); |
|
23 } |
|
24 } |
|
25 return null; |
|
26 } |
|
27 } |