Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- DOM : special chars (entities) in attributes
February 13, 2005, 11:50 am
rate this thread
I currently use the DOM from PHP5 to create XHTML documents.
I have a problem with entities. I would like to create a node :
<input id="place" value="café rouge">
To do that I simply create the node with createElement, and then :
$node -> setAttribute ("value", $val);
If I set $val = "café rouge", the saveXML causes PHP to fail with an
error message. The accentuated character seems to be a problem.
If I set $val = "café rouge", saveXML automatically replaces
the & with & and that's not what I expect either.
Any idea ?
Re: DOM : special chars (entities) in attributes
Perhaps the same as:
i.e. you need to utf8 encode before passing to the DOM functions.
<http://www.andyhsoftware.co.uk/space Space: disk usage analysis tool