x-browsercize selectNodes + transformNode

J

John Smith

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
 
J

John Smith

* John Smith said:
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.
 
M

Martin Honnen

John said:
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_Transformations>

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

John Smith

* Martin Honnen said:
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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top