Replace the element by own text content.

        :param element: The element.
        :type element: hatemile.util.html.htmldomelement.HTMLDOMElement
333904
def _replace_element_by_own_content(self, element):
        
        # pylint: disable=no-self-use

        if element.has_children_elements():
            children = element.get_children_elements()
            for child in children:
                element.insert_before(child)
            element.remove_node()
        elif element.has_children():
            element.replace_node(element.get_first_node_child())
216218
def update_xml_element(self):
        

        if not hasattr(self, 'xml_element'):
            self.xml_element = etree.Element(self.name, nsmap=NSMAP)

        if hasattr(self, 'time'):
            self.xml_element.set('time', self.time_to_str())
        if hasattr(self, 'update'):
            self.xml_element.set('update', str(self.update))
        self.xml_element.text = self.text

        return self.xml_element
1093866
public TextImpl replaceWithText() {
        TextImpl replacement = new TextImpl(document, getData());
        parent.insertBefore(replacement, this);
        parent.removeChild(this);
        return replacement;
    }
476617
def set_node_text(self, node, text):
        
        # Remove any existing Text node children
        for child in self.get_node_children(node):
            if child.nodeType == xml.dom.Node.TEXT_NODE:
                self.remove_node_child(node, child, True)
        if text is not None:
            text_node = self.new_impl_text(text)
            self.add_node_child(node, text_node)
1155248
def add(self, element):
        
        if not isinstance(element, six.string_types):
            raise TypeError("Hll elements can only be strings")
        self._adds.add(element)
200223
def textContent(self, text: str) -> None:  # type: ignore
        """"""
        if self._inner_element:
            self._inner_element.textContent = text
        else:
            # Need a trick to call property of super-class
            super().textContent = text
1194885
def remove(self, element):
        
        if element in self._map:
            return self.evolver().remove(element).persistent()

        raise KeyError("Element '%s' not present in PSet" % element)
461069
def set_element_text(parent_to_parse, element_path=None, element_text=u''):
    

    return _set_element_property(parent_to_parse, element_path, _ELEM_TEXT, element_text)
224268
function ( selector ) {
            var el = this.element(),
                node = $B( selector ).element( true );
    
            if ( el && el.parentNode ) el.parentNode.replaceChild( el, node );
        }
954925
public static void innerHtml(Element element, SafeHtml html) {
        if (element != null) {
            element.setInnerHTML(html.asString());
        }
    }
370248
public Xml addElement(Element element) {
        if(current != null) {
            // attach to existing model
            current.addChildElement(element);
        } else {
            // attach to a new model
            root =  element;
        }
        if(! element.isEmptyElementTag()) {
            current = element;
        }
        return this;
    }
1160776
def set_content(self, content):
        
        if self.allows_content:
            self.content = content.strip()
        else:
            raise UNTLStructureException(
                'Element "%s" does not allow textual content' % (self.tag,)
            )
1256127
def remove(self, element):
        
        if element not in self._counts:
            raise KeyError(element)
        elif self._counts[element] == 1:
            newc = self._counts.remove(element)
        else:
            newc = self._counts.set(element, self._counts[element] - 1)
        return PBag(newc)
1074388
public synchronized void addElement(@NonNull T element) {
        hashCached = false;
        this.elementsMap.put(element.getLabel(), element);
        this.elements.add(element);
    }
1064245
public Element text(String text) {
        Validate.notNull(text);

        empty();
        TextNode textNode = new TextNode(text);
        appendChild(textNode);

        return this;
    }
456950
function textContent(el, text) {
  if (typeof el.textContent === 'undefined') {
    el.innerText = text;
  } else {
    el.textContent = text;
  }
}
900919
function text(element) {
  var type = element.nodeType
    , value = '';

  if (1 === type || 9 === type || 11 === type) {
    //
    // Use `textContent` instead of `innerText` as it's inconsistent with new
    // lines.
    //
    if ('string' === typeof element.textContent) return element.textContent;

    for (element = element.firstChild; element; element = element.nextSibling) {
      value += text(element);
    }
  }

  return 3 === type || 4 === type
  ? element.nodeValue
  : value;
}