Return the text for the given root node (xml.dom.minidom).
518841
def __get_xml_text(root):
    
    txt = ""
    for e in root.childNodes:
        if (e.nodeType == e.TEXT_NODE):
            txt += e.data
    return txt
639553
private String getText(Element element) {
		try {
			for (int i = 0; i < element.getChildNodes().getLength(); i++) {
				Node node = element.getChildNodes().item(i);
				if (node.getNodeType() == Node.TEXT_NODE) {
					return node.getNodeValue();
				}
			}
		} catch (Exception e) {
		}
		return "";

	}
161958
def text(self):
        """"""
        if callable(self._text):
            return str(self._text())
        return str(self._text)
272639
public static String getNodeAttrText(Node node, String attrName) {
        Node fieldNode = node.selectSingleNode(attrName);
        return XmlNodeHelper.getNodeText(fieldNode);
    }
52764
def _extract_node_text(node):
    """"""

    texts = map(
        six.text_type.strip, map(six.text_type, map(unescape, node.xpath(".//text()")))
    )
    return " ".join(text for text in texts if text)
1086995
def _get_xml_doc(self, endpoint, query, is_post=False):
        
        response = self._get_response(endpoint, query, is_post=is_post)
        return minidom.parse(response.text)
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
259464
def getText(node, recursive=False):
    """"""
    L = [u'']
    for n in node.childNodes:
        if n.nodeType in (node.TEXT_NODE, node.CDATA_SECTION_NODE):
            L.append(n.data)
        else:
            if not recursive:
                return None
        L.append(getText(n))
    return u''.join(L)
1243948
def to_xml(self, root):
        '''
        
        '''
        if not len(self.__custom_elements):
            return

        for uri, tags in self.__custom_elements.items():
            prefix, url = uri.split(":", 1)
            for name, value in tags.items():
                self.__createElementNS(root, url, prefix + ":" + name, value)

        return root
1200717
public static String getText(final Node root) {
        if (root == null) {
            return "";
        } else {
            final StringBuilder result = new StringBuilder(1024);
            if (root.hasChildNodes()) {
                final NodeList list = root.getChildNodes();
                for (int i = 0; i < list.getLength(); i++) {
                    final Node childNode = list.item(i);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                        final Element e = (Element) childNode;
                        final String value = e.getAttribute(ATTRIBUTE_NAME_CLASS);
                        if (!excludeList.contains(value)) {
                            final String s = getText(e);
                            result.append(s);
                        }
                    } else if (childNode.getNodeType() == Node.TEXT_NODE) {
                        result.append(childNode.getNodeValue());
                    }
                }
            } else if (root.getNodeType() == Node.TEXT_NODE) {
                result.append(root.getNodeValue());
            }
            return result.toString();
        }
    }
566167
def get_xml(self, encoding='unicode'):
        
        return xml.etree.ElementTree.tostring(self._root_el, encoding)
582139
def parse_root(raw):
    ""
    if sys.version < '3':
        fp = StringIO(raw)
    else:
        fp = BytesIO(raw.encode('UTF-8'))
    for event, element in etree.iterparse(fp, events=('start',)):
        return (element.tag, element.attrib)
426906
def get_text(self, xml, name):
        
        nodes = xml.getElementsByTagName("wp:comment_" + name)[0].childNodes
        accepted_types = [Node.CDATA_SECTION_NODE, Node.TEXT_NODE]
        return "".join([n.data for n in nodes if n.nodeType in accepted_types])
894518
def _get_text(node, tag, default=None):
    """"""
    try:
        return node.find(tag).text
    except AttributeError:
        return default
624423
private String getText(SNode node, VisualizerInput input)
  {
    SDocumentGraph sDocumentGraph = input.getSResult().getDocumentGraph();

    List<DataSourceSequence> sequences = sDocumentGraph.
      getOverlappedDataSourceSequence(node, SALT_TYPE.STEXT_OVERLAPPING_RELATION);

    if (sequences != null && sequences.size() > 0)
    {
      return ((STextualDS) sequences.get(0).getDataSource()).getText().
        substring(sequences.get(0).getStart().intValue(), sequences.get(0).getEnd().intValue());
    }

    return "";
  }
103771
def data(self, root):
        ''''''
        value = self.dict()
        children = [node for node in root if isinstance(node.tag, basestring)]
        for attr, attrval in root.attrib.items():
            attr = attr if self.attr_prefix is None else self.attr_prefix + attr
            value[attr] = self._fromstring(attrval)
        if root.text and self.text_content is not None:
            text = root.text.strip()
            if text:
                if self.simple_text and len(children) == len(root.attrib) == 0:
                    value = self._fromstring(text)
                else:
                    value[self.text_content] = self._fromstring(text)
        count = Counter(child.tag for child in children)
        for child in children:
            if count[child.tag] == 1:
                value.update(self.data(child))
            else:
                result = value.setdefault(child.tag, self.list())
                result += self.data(child).values()
        # if simple_text, elements with no children nor attrs become '', not {}
        if isinstance(value, dict) and not value and self.simple_text:
            value = ''
        return self.dict([(root.tag, value)])
779929
def __get_node_text(self, diagram, node, fmt):
        '''
        
        '''
        fmt_proc = fmt

        # IF blocks
        while (1):
            if_block = re.search('<%if ([^%]*): ([^%]*)%>', fmt_proc)
            if (if_block == None):
                break

            # evaluate condition
            if_cond = if_block[1]
            if_val  = if_block[2]
            if (self.__eval_if_block(if_cond, node) == 0):
                if_val = ''
            fmt_proc = fmt_proc[:if_block.span()[0]] + if_val + fmt_proc[if_block.span()[1]:]

        # {node.ip} = best IP
        ip = node.get_ipaddr()
        fmt_proc = fmt_proc.replace('{node.ip}', ip)

        # stackwise
        stack_block = re.search('<%stack ([^%]*)%>', fmt_proc)
        if (stack_block != None):
            if (node.stack.count == 0):
                # no stackwise, remove this
                fmt_proc = fmt_proc[:stack_block.span()[0]] + fmt_proc[stack_block.span()[1]:]
            else:
                val = ''
                if (self.config.diagram.expand_stackwise == 0):
                    if (self.config.diagram.get_stack_members):
                        for smem in node.stack.members:
                            nval = stack_block[1]
                            nval = nval.replace('{stack.num}',    str(smem.num))
                            nval = nval.replace('{stack.plat}',   smem.plat)
                            nval = nval.replace('{stack.serial}', smem.serial)
                            nval = nval.replace('{stack.role}',   smem.role)
                            val += nval
                fmt_proc = fmt_proc[:stack_block.span()[0]] + val + fmt_proc[stack_block.span()[1]:]
        
        # loopbacks
        loopback_block = re.search('<%loopback ([^%]*)%>', fmt_proc)
        if (loopback_block != None):
            val = ''
            for lo in node.loopbacks:
                for lo_ip in lo.ips:
                    nval = loopback_block[1]
                    nval = nval.replace('{lo.name}', lo.name)
                    nval = nval.replace('{lo.ip}', lo_ip)
                    val += nval
            fmt_proc = fmt_proc[:loopback_block.span()[0]] + val + fmt_proc[loopback_block.span()[1]:]

        # SVIs
        svi_block = re.search('<%svi ([^%]*)%>', fmt_proc)
        if (svi_block != None):
            val = ''
            for svi in node.svis:
                for svi_ip in svi.ip:
                    nval = svi_block[1]
                    nval = nval.replace('{svi.vlan}', svi.vlan)
                    nval = nval.replace('{svi.ip}', svi_ip)
                    val += nval
            fmt_proc = fmt_proc[:svi_block.span()[0]] + val + fmt_proc[svi_block.span()[1]:]

        # replace {stack.} with magic
        fmt_proc = re.sub('{stack\.(([a-zA-Z])*)}', '$stack2354$\g<1>$stack2354$', fmt_proc)
        fmt_proc = re.sub('{vss\.(([a-zA-Z])*)}', '$vss2354$\g<1>$vss2354$', fmt_proc)

        # {node.} variables
        fmt_proc = fmt_proc.format(node=node)
        
        # replace magics
        fmt_proc = re.sub('\$stack2354\$(([a-zA-Z])*)\$stack2354\$', '{stack.\g<1>}', fmt_proc)
        fmt_proc = re.sub('\$vss2354\$(([a-zA-Z])*)\$vss2354\$', '{vss.\g<1>}', fmt_proc)

        return fmt_proc