Re: DOMElement - attributes and namespace
| From: | Michael A. Peters | Date: | Sun, 22 Mar 2009 10:56:10 +0000 |
| Subject: | Re: DOMElement - attributes and namespace | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290525@lists.php.net to get a copy of this message | ||
Michael A. Peters wrote:
Michael A. Peters wrote:I found a dirty fix - it works but isn't proper. I think this is a bug in either $node->elements or DOMAttr Either the first needs to provide a way to tell what is before the : when a : exists in an attribute name or the second needs to either provide it in DOMAttr->name or provide another way to access what (if anything) is before a semicolon. At some point I'll get the guts to report it as a bug just to be told it isn't a bug with the standard response that says it isn't a bug and absolutely no explanation as to why.Here's the problem - $attributes = $node->attributes; creates a list that has both regular attributes and namespaced attributes. But I don't know how to programatically tell them apart.http://phpbuilder.com/manual/en/class.domattr.php What would be really nice is if I could do $attribute->namespace the same way I could do $attribute->name and $attribute->value That would easily allow me to solve the problem. Is there a reason why that isn't part of the DOMAttr class?