Re: Change to Attr interface in light of XPath

Robin Berjon <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <[email protected]>
On 18/02/2014 21:02 , Justin Summerlin wrote:
> But by not fully inheriting from Node, we lose symmetry with other types
> of objects returned from XPath queries; we lose nodeType for example. If
> I get a result object and nodeType tells me nothing, I need to look at
> the prototype of the object or look at ownerElement, in this case, and
> see if that object is in the attribute list just to know what kind of
> object I'm working with.

Inheriting fully from Node is pretty heavy-handed, and for many things 
feels quite unnatural.

Do you have an implementation of XPath in JS? Maybe the simplest thing 
would be to show what information you need on Attr for it to work; it's 
likely to cover general-purpose requirements pretty well.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.