Connecting Tech Pros Worldwide Forums | Help | Site Map

x-browsercize selectNodes + transformNode

John Smith
Guest
 
Posts: n/a
#1: Feb 20 '07


I'm trying to make some Javascript X-browser.

foo is a HTML DOM.

I have foo.documentElement.selectNodes("xpath"); in the source.
I see later down there is also a foo.transformNode. Yuck.

Has someone written a x-browser selectNodes/transformNode implementation
so that I can get this code working in a non IE browser??

Any recommendations (other than flames, unless they too contain a
recommendation) greatly appreciated :-D

John Smith
Guest
 
Posts: n/a
#2: Feb 20 '07

re: x-browsercize selectNodes + transformNode


* John Smith wrote:
Quote:
>
I'm trying to make some Javascript X-browser.
>
foo is a HTML DOM.
>
I have foo.documentElement.selectNodes("xpath"); in the source.
I see later down there is also a foo.transformNode. Yuck.
>
Has someone written a x-browser selectNodes/transformNode implementation
so that I can get this code working in a non IE browser??
>
Any recommendations (other than flames, unless they too contain a
recommendation) greatly appreciated :-D
As an afterthought I could quite easily knock up a webservice that
contains the method selectNodes (and returns a DOM) and transformNode
(that returns a DOM) and just change the Javascript so that it calls
these two new web methods, however this seems to me to be a bit of a hack.
Martin Honnen
Guest
 
Posts: n/a
#3: Feb 20 '07

re: x-browsercize selectNodes + transformNode


John Smith wrote:
Quote:
>
I'm trying to make some Javascript X-browser.
>
foo is a HTML DOM.
>
I have foo.documentElement.selectNodes("xpath"); in the source.
I see later down there is also a foo.transformNode. Yuck.
>
Has someone written a x-browser selectNodes/transformNode implementation
so that I can get this code working in a non IE browser??
Since then does IE support selectNodes or transformNode on a HTML DOM?
As for other browsers and XPath support, Mozilla and Opera 9 support the
W3C DOM Level 3 XPath
<http://www.w3.org/TR/DOM-Level-3-XPath/>
As for other browsers and scripted XSLT support, for Mozilla and for
Opera 9 see

<http://developer.mozilla.org/en/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Tran sformations>

XSLT and XPath in both Mozilla and Opera works on both XML DOM trees and
HTML DOM trees.


--

Martin Honnen
http://JavaScript.FAQTs.com/
John Smith
Guest
 
Posts: n/a
#4: Feb 20 '07

re: x-browsercize selectNodes + transformNode


* Martin Honnen wrote:
Quote:
John Smith wrote:
Quote:
>>
>I'm trying to make some Javascript X-browser.
>>
>foo is a HTML DOM.
>>
>I have foo.documentElement.selectNodes("xpath"); in the source.
>I see later down there is also a foo.transformNode. Yuck.
>>
>Has someone written a x-browser selectNodes/transformNode implementation
>so that I can get this code working in a non IE browser??
>
Since then does IE support selectNodes or transformNode on a HTML DOM?
erm XML DOM?

My point was I have a load of code that uses selectNodes and
transformNode and (obviously) it doesn't work in other browsers and I
was hoping there might be a simple way of getting something quick and
dirty running. Perhaps using prototyping to add these methods where they
are lacking to any other DOM i'm using, so I don't have to change the
existing code (easier for testing, and also better for me not cocking up
anything that currently works by touching it).

I saw mozxpath.js , but now I've found Sarissa and to be honest it looks
like it might be the way to go but I know nothing about this kind of
stuff so I was looking for helpful comments :-)
Closed Thread


Similar JavaScript / Ajax / DHTML bytes