Title: RE: [phpXML] Bug in setAttributes
Thanks all folks,
 
Oliver
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: woensdag 26 september 2001 13:37
To: [EMAIL PROTECTED]
Subject: [phpXML] Bug in setAttributes

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?

The array that you use for setAttributes should be an associative array, so you are effectively doing:

    setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array(0 => "atr1", 1 => "atr2"));)
 
Hence you end up with:
 
    <Nodename 0="atr1" 1="atr2"/>
 
Try:
 
    setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array("atr1" => "value1", "atr2" => "value2"));)
 
===========================
For the most recent version of phpxml, V1.N.X, and an archive of this list
visit:  http://www.sourceforge.net/projects/phpxmldb

Reply via email to