By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,663 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,663 IT Pros & Developers. It's quick & easy.

x-browsercize selectNodes + transformNode

P: n/a


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
Feb 20 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
* John Smith wrote:
>
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.
Feb 20 '07 #2

P: n/a
John Smith wrote:
>
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/
Feb 20 '07 #3

P: n/a
* Martin Honnen wrote:
John Smith wrote:
>>
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 :-)
Feb 20 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.