Re: Problem with DOM

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

 



Hi

Got it working as expected. Try the following modified class

class customer {
	$name;
	$phone;

	function customer($name, $phone) {
		$this->name = $name;
		$this->phone = $phone;
	}

	function getName() {
		return $name;
	}

	function setName($name) {
		$this->name = $name;
	}

	function getPhone() {
		return $phone;
	}

	function setPhone($phone) {
		$this->phone = $phone;
	}

	function addXMLCustomer($dom) {
		$customer = $dom->createElement('customer');
		$customer->setAttribute('name', $this->name);
		$customer->setAttribute('phone', $this->phone);

		$dom->documentElement->appendChild($customer);
	}
}

HTH
--
Niel Archer



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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux