Re: XML_Serializer: adding attributes

From: Date: Thu, 26 Aug 2004 17:08:34 +0000
Subject: Re: XML_Serializer: adding attributes
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14302@lists.php.net to get a copy of this message
Charles Gebhard wrote:
i was playing around with XML_Serializer the other day and could not figure out how to put attributes in the resulting XML doc.
XML_Serializer wasn't really made to do that sort of thing. You'd be better off using XML_FastCreate if all you want to do is crank out an XML document. require_once 'XML/FastCreate.php'; $x =& XML_FastCreate::factory('Text'); $x->books(
    $x->book(array('id' => '455', 'lang' => 'en'),
        $x->author(array('email' => 'jim@nowhere.org'), 'Jim'),
        $x->title(array('alt' => 'more stuff'), 'stuff')
    )
); $x->toXML(); Aaron

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