How to use node-set function in a platform-independent way?

后端 未结 5 1848
谎友^
谎友^ 2020-12-02 01:49

I\'m writing some xlst file which I want to use under linux and Windows. In this file I use node-set function which declared in different namespaces for MSXML and xsltproc

5条回答
  •  萌比男神i
    2020-12-02 02:12

    Yes, there is a good and universal solution.

    EXSLT's function common:node-set() can be implemented as an inline Javascript function and is thus available with any browser that supports Javascript (practically all major browsers without exception).

    This technique was first discovered by Julian Reschke and after he published it on the xsl-list, was publicized by David Carlisle. On the blog of David Carlisle there is also a link to a test page that shows if the common:node-set() function thus implemented works with the browser of your choice.

    To summarize:

    1. First go here and read the explanation.
    2. Then try the test page. In particular, verify that it works with IE (that means with MSXML)
    3. Finally, use the code.

    Do enjoy!

提交回复
热议问题