Re: Error with DOMDocument->saveXML()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 29 September 2005 12:26 pm, Stephen Leaf wrote:

I have figured it out!
My guess couldn't have been more _wrong_.
Here is all you need to recreate the Error.
There is only 1 value that is off.
in the DOMDocument I gave it the wrong encoding type.
uft-8 .. it should read utf-8.
Interesting that PHP doesn't tell you about a bad encoding type.

<?php
	class test {
		private $Dom;

		function __construct ($rootName) {
			$this->Dom = new DOMDocument('1.0', 'uft-8');
			$this->Dom->appendChild($this->Dom->createElement($rootName));
		}
		function __toString() {
			return $this->Dom->saveXML();
		}
	}

	$test = new test("test");
	echo $test;
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux