Re: SimpleXML and Default Cast To String
| From: | Marcus Boerger | Date: | Tue, 13 Jan 2004 06:39:55 +0000 |
| Subject: | Re: SimpleXML and Default Cast To String | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7041@lists.php.net to get a copy of this message | ||
Hello Andi,
Tuesday, January 13, 2004, 7:35:05 AM, you wrote:
> At 07:21 PM 1/12/2004 -0500, Sterling Hughes wrote:
>>I'm not arguing whether or not getChildren() is easier. Of course it
>>is. I'm arguing that getChildren() is not within the spirit of the
>>simplexml extension, which is explicitly designed to be without accessor
>>methods. I further, because of the availability of XPath don't see the
>>need to have such an accessor. Perhaps I would reconsider if this were
>>a particularly hard problem to solve without internal functions, but
>>when its so simple, I don't see the point.
>>
>>There are plenty of other utility API's the extension could have that
>>will help in using it. getElementsByTagName() is a great function to
>>have - its simple *and* more efficient than Xpath, why isn't it there?
>>Because that's not what this extension is about. Its not about an
>>"easy" API for XML, or an "efficient" API for XML. Although it is
>>signifigantly easier and more efficient. It's a *simple*, uncluttered
>>API for XML.
> I think that no matter what, it stays simple because you don't have to use
> the methods. The methods make it "easy" and quite a bit more powerful.
>>SimpleXML is *not* supposed to reinvent DOM. It is supposed to be a
>>data structure view of XML that can easily be integrated with other
>>future components (such as XmlReader and XmlWriter API's).
> It's not supposed to be DOM but I think there's a lot of added value in
> making it easy/simple to do some of the basic methods. I agree it shouldn't
> be bloated with all of DOM's capabilities.
I guess nobody wants a whole bunch of methods in SXE.
>>I can accept getChildren() and getAttributes() (or better, just
>>children() and attributes()) as methods on objects, but I'm not happy
>>with them at all. These two methods were considered for inclusion in
>>my original thoughts on simplexml, and I decided against them for the
>>reasons I've mentioned above. Anyhow, shall we put it to a vote on
>>these two methods and move on?
>>
>>I'm -1 on having them.
> +1 and I prefer get*() :)
+1 too and they only make sense if they are named get*() because that are
the names of the interface methods they implement.
--
Best regards,
Marcus mailto:helly@php.net