xsl-list
[Top] [All Lists]

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

2008-02-18 05:57:24
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--