Clover Coverage Report - Liquibase Core 2.0.2
Coverage timestamp: Wed Aug 3 2011 19:29:16 EDT
../../img/srcFileCovDistChart0.png 69% of files have more coverage
7   27   3   7
4   17   0.43   1
1     3  
1    
 
  XMLUtil       Line # 10 7 0% 3 12 0% 0.0
 
No Tests
 
1    package liquibase.util;
2   
3    import org.w3c.dom.Node;
4    import org.w3c.dom.NodeList;
5    import org.w3c.dom.Text;
6   
7    /**
8    * Various utility methods for working with XML.
9    */
 
10    public class XMLUtil {
11    /**
12    * Extracts the text from the given element. Element.getTextContet() is java5 specific, so we need to use this until
13    * we drop 1.4 support.
14    */
 
15  0 toggle public static String getTextContent(Node element) {
16  0 StringBuffer text = new StringBuffer();
17  0 NodeList childNodes = element.getChildNodes();
18  0 for (int i = 0; i < childNodes.getLength(); i++) {
19  0 Node child = childNodes.item(i);
20  0 if (child instanceof Text) {
21  0 text.append(child.getNodeValue());
22    }
23    }
24   
25  0 return text.toString();
26    }
27    }