createtextnode

How do I prevent Php's DOMDocument from encoding html entities?

I have a function that replaces anchors' href attribute in a string using Php's DOMDocument. Here's a snippet: $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadHTML($text); $anchors = $doc->getElementsByTagName('a'); foreach($anchors as $a) { $a->setAttribute('href', 'http://google.com'); } return $doc->saveHTML(); The ...

JavaScript TextNode update

If I have a var t = document.createTextNode(text) parent.appendChild(t); Is it possible to simply update the contents of t? I would like to change the text inside the parent without using removeChild, createTextNode and appendChild. Why would I need this instead of just using innerHTML? Because I don't want to update the contents of ...

Integers in TextNodes w/ Python minidom

I am working on an API using SOAP and WSDL. The WSDL expects integers to come through. I am fairly new to ALL of this, and constructing XML in Python. I have chosen to use minidom to create my SOAP message. So using minidom, to get a value into a node I found I have to do this: weight_node = xml_file.createElement("web:Weight") weight...