Re: Problem with DOM
| From: | Niel Archer | Date: | Tue, 12 May 2009 22:40:06 +0000 |
| Subject: | Re: Problem with DOM | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-29331@lists.php.net to get a copy of this message | ||
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