note 108453 added to domtext.construct
| From: | Thomas | Date: | Fri, 27 Apr 2012 13:54:36 +0000 |
| Subject: | note 108453 added to domtext.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187376@lists.php.net to get a copy of this message | ||
I experinced that DOMText, given a integer as only value to the constructor failed to return valid
data. I had to typecast the input to a string first:
$intValue = 3252; // Post/Zip-code
$some_element->appendChild( new DOMText( (string) $intValue) );
When not typecasting using "(string)" the XML output from $root->saveXML() would not
validate.
----
Server IP: 69.147.83.197
Probable Submitter: 84.49.48.178
----
Manual Page -- http://www.php.net/manual/en/domtext.construct.php
Edit -- https://master.php.net/note/edit/108453
Del: integrated -- https://master.php.net/note/delete/108453/integrated
Del: useless -- https://master.php.net/note/delete/108453/useless
Del: bad code -- https://master.php.net/note/delete/108453/bad+code
Del: spam -- https://master.php.net/note/delete/108453/spam
Del: non-english -- https://master.php.net/note/delete/108453/non-english
Del: in docs -- https://master.php.net/note/delete/108453/in+docs
Del: other reasons-- https://master.php.net/note/delete/108453
Reject -- https://master.php.net/note/reject/108453
Search -- https://master.php.net/manage/user-notes.php