Here you can find the source of firstTextChild(Element el)
Parameter | Description |
---|---|
el | a parameter |
public static Text firstTextChild(Element el)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.Text; public class Main { /**// w w w . j a v a 2 s . c o m * @param el * @return the first text child of an element, or null if it has none */ public static Text firstTextChild(Element el) { Text text = null; for (int i = 0; i < el.getChildNodes().getLength(); i++) { Node n = el.getChildNodes().item(i); if (n instanceof Text) text = (Text) n; } return text; } }