Returns the first text or CDATA node in the current sequence of text and
CDATA nodes.
975543
private TextImpl firstTextNodeInCurrentRun() {
        TextImpl firstTextInCurrentRun = this;
        for (Node p = getPreviousSibling(); p != null; p = p.getPreviousSibling()) {
            short nodeType = p.getNodeType();
            if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
                firstTextInCurrentRun = (TextImpl) p;
            } else {
                break;
            }
        }
        return firstTextInCurrentRun;
    }
345165
function getPseudoClass1() {
  const type = NodeType.PseudocType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  // Skip `:`.
  pos++;

  content.push(getIdent());

  {
    const type = NodeType.ArgumentsType;
    const token = tokens[pos];
    const line = token.ln;
    const column = token.col;

    // Skip `(`.
    pos++;

    const selectorContent = [].concat(
      getSC(),
      getSelectorsGroup(),
      getSC()
    );

    const end = getLastPosition(selectorContent, line, column, 1);
    const args = newNode(type, selectorContent, line, column, end);
    content.push(args);

    // Skip `)`.
    pos++;
  }

  return newNode(type, content, line, column);
}
1224981
public @Nonnull String text() {
        return new NodeListSpliterator(node.getChildNodes()).stream()
                        .filter(it -> it instanceof Text)
                        .map(it -> ((Text) it).getNodeValue())
                        .collect(joining());
    }
249748
protected int getNextNode()
  {
    m_lastFetched = (DTM.NULL == m_lastFetched)
                     ? m_cdtm.getFirstAttribute(m_context)
                     : m_cdtm.getNextAttribute(m_lastFetched);
    return m_lastFetched;
  }
105011
def get_text(nodelist):
    

    s = ''
    for node in nodelist:
        if node.nodeType == Node.TEXT_NODE:
            s += node.nodeValue + ', '

    if len(s)>0: s = s[:-2]
    return s
1099062
function getTextNodes(el) {
  el = el || document.body

  var doc = el.ownerDocument || document
    , walker = doc.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false)
    , textNodes = []
    , node

  while (node = walker.nextNode()) {
    textNodes.push(node)
  }
  return textNodes
}
1191780
static String getElementText(Element element) {
        StringBuffer buf = new StringBuffer();

        NodeList children = element.getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            Node node = children.item(i);
            if (node.getNodeType() == Node.TEXT_NODE ||
                    node.getNodeType() == Node.CDATA_SECTION_NODE) {
                Text text = (Text) node;
                buf.append(text.getData().trim());
            }
        }

        return buf.toString();
    }
707343
def title(node):
    
    return nodes.title(node.first_child.literal, node.first_child.literal)
215770
function findNodeWithFirstChar(nodeList, char) {
    return [...nodeList].findIndex((el) => el.innerText.charAt(0).toLowerCase() === char.toLowerCase());
}
55650
function xmlText(node, opt_cdata) {
  var buf = [];
  xmlTextR(node, buf, opt_cdata);
  return buf.join('');
}
258533
def assign_texts(node, words, next_idx=0):
    
    if len(node.children) == 0:
        node.text = words[next_idx]
        return next_idx + 1
    else:
        for child in node.children:
            next_idx = assign_texts(child, words, next_idx)
        return next_idx
373873
def get_text(nodelist):
    """"""
    value = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            value.append(node.data)
    return ''.join(value)
561735
public String text() {
        if (value instanceof String) {
            return (String) value;
        }
        if (value instanceof NodeList) {
            return ((NodeList) value).text();
        }
        if (value instanceof Collection) {
            Collection coll = (Collection) value;
            String previousText = null;
            StringBuilder sb = null;
            for (Object child : coll) {
                String childText = null;
                if (child instanceof String) {
                    childText = (String) child;
                } else if (child instanceof Node) {
                    childText = ((Node) child).text();
                }
                if (childText != null) {
                    if (previousText == null) {
                        previousText = childText;
                    } else {
                        if (sb == null) {
                            sb = new StringBuilder();
                            sb.append(previousText);
                        }
                        sb.append(childText);
                    }
                }
            }
            if (sb != null) {
                return sb.toString();
            } else {
                if (previousText != null) {
                    return previousText;
                }
                return "";
            }
        }
        return "" + value;
    }
147003
public static function get_next_textnode( \DOMNode $node = null ) {
		return self::get_adjacent_textnode(
			function( &$another_node = null ) {
				$another_node = $another_node->nextSibling;
				return self::get_first_textnode( $another_node );
			},
			[ __CLASS__, __FUNCTION__ ],
			$node
		);
	}
1001217
def get_first_of_element(element, sub, contype=None):
    
    content = element.xpath(sub)
    return list_or_empty(content, contype)
647960
def get_sequence_value(node):
        
        assert node.datatype() == 15
        data = defaultdict(list)
        cols = []
        for i in range(node.numValues()):
            row = node.getValue(i)
            if i == 0:  # Get the ordered cols and assume they are constant
                cols = [str(row.getElement(_).name()) for _ in range(row.numElements())]

            for cidx in range(row.numElements()):
                col = row.getElement(cidx)
                data[str(col.name())].append(XmlHelper.as_value(col))
        return pd.DataFrame(data, columns=cols)
983634
def get_sequence_value(node):
        
        assert node.Datatype == 15
        data = defaultdict(list)
        cols = []
        for i in range(node.NumValues):
            row = node.GetValue(i)
            if i == 0:  # Get the ordered cols and assume they are constant
                cols = [str(row.GetElement(_).Name) for _ in range(row.NumElements)]

            for cidx in range(row.NumElements):
                col = row.GetElement(cidx)
                data[str(col.Name)].append(XmlHelper.as_value(col))
        return DataFrame(data, columns=cols)