Re: SimpleXML and Default Cast To String

From: Date: Thu, 08 Jan 2004 07:39:42 +0000
Subject: Re: SimpleXML and Default Cast To String
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-6844@lists.php.net to get a copy of this message
At 06:59 PM 1/7/2004 -0500, Adam Maccabee Trachtenberg wrote:
So i'd say let us add a method for returning the complete content. Adam could you do that? That wouldn't be too difficult (although I am busy for the next day or two). However, as much as I loathe toggles, I'm wondering if it wouldn't be better to make this an object-wide setting. My thought are that on an object-by-object basis, you either always want tags or never want them. Something like: $sxe = simplexml_load_file('doc.xml'); $sxe->displayTags = true; This would keep the interface clean. Or would that just confuse things with more magic?
If anything then displayTags() should be a method so that it doesn't get ambiguous with accessing XML fields.
Also, what would the default behavior should be? I can argue both sides of the issue right now. :)
I agree. It's definitely confusing and both sides could be argued. I think I lean towards today's implementation. It does seem to be more in-line with XML and it's structure. I'd keep things the way they are today. Andi

« previous php.internals (#6844) next »