Re: XML_Serializer: adding attributes

From: Date: Thu, 26 Aug 2004 17:26:54 +0000
Subject: Re: XML_Serializer: adding attributes
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14303@lists.php.net to get a copy of this message
Charles Gebhard wrote:
'attributesArray' // all values in this key will be treated as attributes
see the serializeWithAttributes2 example $options = array(
   "indent"   => "    ",
   "linebreak"          => "\n",
   "rootName"           => "books",
"scalarAsAttributes" => false,
   "attributesArray"    => '_attributes',
   "contentName"        => '_content'
); $data = array(
    'book' => array(
        'author' => array(
             '_attributes' => array( 'id' => '455', 'lang' => 'en' ),
             '_content'    => 'Jim'),
        'title' => array(
             '_attributes' => array( 'alt' => 'more stuff' ),
             '_content' => 'stuff')
     )
);
thanks for any help. -chuck


« previous php.pear.general (#14303) next »