note 92463 added to domdocument.createtextnode
| From: | AlexKaye at osu1 dot php dot net | Date: | Sat, 25 Jul 2009 14:04:36 +0000 |
| Subject: | note 92463 added to domdocument.createtextnode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158718@lists.php.net to get a copy of this message | ||
A quick note to anyone who is using character entities (e.g. ©) in this, and finding them
automatically escaped. The correct thing to do here is to use the createEntityReference method (e.g.
createEntityReference("copy");), and then appendChild this entity between text nodes.
Example:
$copyright_text_1 = $this->document->createTextNode("Copyright ");
$copyright_text_2 = $this->document->createTextNode(" Alex Kaye 2009");
$copyright_symbol = $this->document->createEntityReference("copy");
$copyright->appendChild($copyright_text_1);
$copyright->appendChild($copyright_symbol);
$copyright->appendChild($copyright_text_2);
----
Server IP: 87.124.35.190
Probable Submitter: 90.221.13.107
----
Manual Page -- http://www.php.net/manual/en/domdocument.createtextnode.php
Edit -- https://master.php.net/note/edit/92463
Del: integrated -- https://master.php.net/note/delete/92463/integrated
Del: useless -- https://master.php.net/note/delete/92463/useless
Del: bad code -- https://master.php.net/note/delete/92463/bad+code
Del: spam -- https://master.php.net/note/delete/92463/spam
Del: non-english -- https://master.php.net/note/delete/92463/non-english
Del: in docs -- https://master.php.net/note/delete/92463/in+docs
Del: other reasons-- https://master.php.net/note/delete/92463
Reject -- https://master.php.net/note/reject/92463
Search -- https://master.php.net/manage/user-notes.php