Hi Marcus

On 3/30/06, Marcus Boerger <[EMAIL PROTECTED]> wrote:
> Hello Hannes,
>
> Thursday, March 30, 2006, 9:26:27 PM, you wrote:
>
> > On 3/30/06, Marcus Boerger <[EMAIL PROTECTED]> wrote:
> >> Hello Pierre,
> >>
> >>   this is actually a bug fix not a feature change or whatever.
> >> if you do '$reader->getAttribute($name) you right now have no way of
> >> figuring out whether the attribute is empty or does not exist. I
> >> found that out while doing my slides on xmlReader over the weekend.
> >> We discussed it here in Montreal and all agreed that NULL is the best
> >> option since in contrast to false it also allows to use isset() and
> >> empty() on the return value.
>
> > Returning "" is however compatible with DOMElement->getAttribute()...
>
> If that is the case then it is an error there, too. I must admit i never
> use DOM so i don't know and don't care either.
>
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9
"Return Value
DOMString The Attr value as a string, or the empty string if that
attribute does not have a specified or default value."
Doesn't really say what to do if the attribute doesn't exist, but it
return DOMString so understand it as it should return empty string.

However, DOM has hasAttribute() which returns boolean.

As I see it, E_NOTICE should be thrown since accessing uninitialized
variable triggers E_NOTICE, why not XML attribute?
(yeah, massive BC break so no chance in hell I'd recommend
implementing it though)

- Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to