[phpXML] RE: [phpXML] Bug in setAttributes
Brought to you by:
bs_php,
nigelswinson
From: <o.t...@ab...> - 2001-10-08 18:05:43
|
After using setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array("atr1","atr2"));) I get the following incorrect result: <Nodename 0="atr1" 1="atr2"/> Where do the 0 and 1 come from? Oliver -----Original Message----- From: a.t...@fl... [mailto:a.t...@fl...] Sent: woensdag 26 september 2001 10:02 To: us...@li... Subject: [phpXML] Bug in setAttributes Hi, just patched phpxml 1.N.5: // OLD -------------------------------------------------- function setAttributes($absoluteXPath, $attribute) { // The attributes parameter should be an associative array. if (!is_array($attributes)) return; // Add the attributes to the node. if (isSet($this->nodes[$path]['attributes'])) { $this->nodes[$path]['attributes'] = array_merge($this->nodes[$path]['attributes'], $attributes); } else { $this->nodes[$path]['attributes'] = $attributes; } } Tell me where the $path variableis set and why the parameter $attribute is called $attributes in the function... // NEW -------------------------------------------------- function setAttributes($absoluteXPath, $attributes) { // The attributes parameter should be an associative array. if (!is_array($attributes)) return; // Add the attributes to the node. if (isSet($this->nodes[$absoluteXPath]['attributes'])) { $this->nodes[$absoluteXPath]['attributes'] = array_merge($this->nodes [$absoluteXPath]['attributes'], $attributes); } else { $this->nodes[$absoluteXPath]['attributes'] = $attributes; } } BTW, did anyone check the code before releasing it? How else could one miss those bugs like the "$this ->" thing and the setAttributes-function, that did not work at all. CU, Axel -- a.t...@fl... PS, soory for my bad english... -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |