[webkit-dev] xmlns attribute

Rob Burns robburns1 at mac.com
Sat Sep 2 13:54:31 PDT 2006


On Sep 1, 2006, at 10:14 PM, David Hyatt wrote:

> On Sep 1, 2006, at 6:50 PM, Rob Burns wrote:
>
>> Hello all,
>>
>> I think I've encountered a few bugs, but wanted to post  here  
>> before I submit them to make sure I'm not doing something wrong.
>>
>> First, when I use "getAttribute:xmlns:SomePrefix" on a DOMElement  
>> it returns NUL even though this attribute is set on the root  
>> element and is still valid for the current scope. I thought this  
>> attribute was inherited and therefore should work on any sub- 
>> element in the hierarchy (scope). If that's not the proper way to  
>> get the namespaceURI for a namespacePrefix, is there another  
>> method for that?
>>
>
> getAttribute is just about explicit attribute declarations in the  
> DOM, so no, this should not work on any sub-element in a  
> hierarchy.  To get the namespace URI on your element you can just say
>
> myElement.namespaceURI
>
> This value will reflect the actual computed namespace URI for that  
> element.

The method Is was looking for in this earlier query were  
"lookupNamespaceURI" and "lookupPrefix". They're both DOM level 3  
methods, but they weren't documented in the headers yet. I was  
wondering how to use namespaces sufficiently without a such a method.
j
Best wishes,
Rob



More information about the webkit-dev mailing list