I was recently working on a web application and I needed to
collect nodes in an XHR request's responseXML property. I figured as
this object also followed the DOM specification that it would work for
the Element.getElementsBySelector function but unfortunately this
returned no results. Any ideas? This could definitely be a great
leverage for prototype, the XPATH 'standard' is roughly supported.
Matt a écrit :
> I was recently working on a web application and I needed to
> collect nodes in an XHR request's responseXML property. I figured as
> this object also followed the DOM specification that it would work for
> the Element.getElementsBySelector function but unfortunately this
> returned no results. Any ideas? This could definitely be a great
It doesn't work because we extend HTMLElement, not Element (the DOM
interface), which does not lend itself to extension at all.
> leverage for prototype, the XPATH 'standard' is roughly supported.
I'm not sure about what you mean here by "roughly" ("almost everywhere"
or "barely anywhere" ;-)).
At any rate, I don't believe Core would be interested in implementing an
extraction layer over *any* DOM, including XML DOM, if only because XML,
as a data format for AJAX responses, is dead in the water. Hardly
anybody bothers to deal with it on the client side, when formats such as
JSON are so much easier, and faster, to deal with.
However, if someone wants to come up with a tested add-on, please do!
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: t...@tddsworld.com
Yeah I figured it was to do with the HTMLElement.prototype extensions,
although the hack it performs for IE, could that be performed on the
XML obj?
Anyways I'll look into this further, customizations are always fun,
thanks for the advice.
On Jun 13, 4:22 am, "Mark Holton" <holto...@gmail.com> wrote:
> for those interested:http://developer.mozilla.org/presentations/xtech2005/e4x/
>
> On 6/13/07, Mark Holton <holto...@gmail.com> wrote:
>
>
>
> > What about E4X <http://en.wikipedia.org/wiki/E4X>? It is already part of