Re: [xsl] Using native XPath in IE with Javascript

Subject: Re: [xsl] Using native XPath in IE with Javascript
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 18 Feb 2008 13:56:50 +0100
Manfred Staudinger wrote:
Hi,

>From a posting back in 2004 by Dimitri Glazkov, speaking about IE (I
would be interested in the second case only):
I mean, you can very much do XPath in JavaScript, except it can
only occur in two
cases (that I know of):
1) As call to an Msxml.DOMDocument object, created using the new
ActiveXObject() statement.
2) If an HTML document was generated as a result of a client-side
XSL transformation
from an XML file.
http://glazkov.com/blog/xpath-unleashed/

3) on the current HTML document that is loaded in the browser. However, note that you have to reload it in a freethreaded DOM object to make it work with XSLT (iirc).


4) in an msxml:script object, though I wouldn't recommend it.

Using XSLT in a browser through JavaScript is usually easiest with the excellent open source Sarissa, which takes away the burden of little differences in calling XPaths directly (i.e., the function parameter for the namespace is at the end in FF/Op and at the beginning in IE).

Cheers,
-- Abel Braaksma

Current Thread