473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

x-browsercize selectNodes + transformNode



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
3 2390
* 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
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
* 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: e-mid | last post by:
i want to get childs of specific xml node. normally i use xmlNodeList fooList = myNode.SelectNodes("foo"); but in compactframework , there is no selectNodes() method or selectSingleNode()...
1
by: Riko Eksteen | last post by:
Hi I am writing an application that listens to the NodeInserted event, and if the event is fired it does a selectnodes xpath query on the XmlDocument. Only problem is, when I call...
2
by: Michael H | last post by:
Hello group, I have a some xml that looks like this below: <tuneRequests ct="3" xmlns:sql="urn:schemas-microsoft-com:xml-sql" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <tr...
2
by: Linda Boumarafi | last post by:
Hi, This is a newbie question to XMLNS. I just finished the article on "XML Namespaces and How They Affect XPath and XSLT" by Dare Obasanjo and I'm pretty sure I understand the problem. I just...
2
by: Joe Kraft | last post by:
We just turned on a new website that runs on an XML/XSL templates that get transformed using various .Net objects. The final call is to the MSXML3 TransformNode function. Though the page loads as...
2
by: Joe | last post by:
Hello All: Does anyone know the differnce between the GetElementsByTagName method and the SelectNodes method? I know that they take different arguments. They also both return a NodeList. I'm...
0
by: Johan | last post by:
Hi! I have a problem with my app which is mixed .NET and native code. The problem is of course with the well-known buggy EnableVisualStyles. Now, at first I called:...
2
by: DeveloperX | last post by:
SelectNodes under 1.1 is confusing me. Imagine an xml file that looks like this. It's just an example: <drive> <dir a="a"> <file>aA</file> <file>aB</file> <dir a="ab"> <file>abA</file> <dir...
3
by: Alan Mailer | last post by:
Ok, I've looked for an answer for this, because I'm sure it's been asked a thousand times... but no luck... so here goes. Imagine I want to create a NodeList based on an XPath statement. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.