Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24541 invoked by uid 1010); 20 Jan 2004 00:13:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24476 invoked from network); 20 Jan 2004 00:13:39 -0000 Received: from unknown (HELO miranda.org) (209.58.150.153) by pb1.pair.com with SMTP; 20 Jan 2004 00:13:39 -0000 Received: (qmail 10162 invoked by uid 546); 20 Jan 2004 00:13:38 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Jan 2004 00:13:38 -0000 Date: Mon, 19 Jan 2004 19:13:38 -0500 (EST) X-X-Sender: adam@miranda.org To: internals@lists.php.net Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: PATCH: SimpleXML asXML() From: adam@trachtenberg.com (Adam Maccabee Trachtenberg) SimpleXML's asXML() method always returns the entire document regardless of the node. I believe (Sterling?) we decided the correct behavior here is to only return the XML data for the current node and its children. A patch to fix the behavior is available here: http://www.trachtenberg.com/patches/simplexml_asXML_patch.txt Note that with this patch, calling asXML() on an attribute will return just the attribute and its value, not the element where the attribute is located. For example: foo="bar" instead of . I think this makes sense, but it's probably easy to change. -adam -- adam@trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!