Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- new DomElement and Ampersand(&) in string
July 16, 2005, 4:39 pm
rate this thread
I'm trying the following code (ultimately I want a node with a URI like
$foo = new DomElement('foo','foo&bar');
and get the following error message
TEXT: unterminated entity reference bar
LOCATION: /users/peter/store/index.php, line 3, at July 16, 2005, 9:35
DOMElement.__construct("foo", "foo&bar") # line 3, file:
I cannot find a way to escape the ampersand so that the DomElement
constructor will take it as a character. I tried & which is no
different, I tried \& which is no different.
Re: new DomElement and Ampersand(&) in string
When appending '&Login' to the end of a uri that already contains some
ampersands I also have to play a trick where i replace any existing
ampersands with '&' before appending '&Login' and then create
the document element.