Replacement of <xsl:eval> and <xsl:script> in XSL

I am trying to modify an xsl which is of the older version. I come across the following


function FormatAccount(e) {
   // function details

             I am trying to call the FormatAccount() javascript function using `<xsl:eval>` and the function is written in `<xsl:script>`.

How to do this as per the latest standards????


The latest standard is XSLT 2.0, it does not have any facility to define functions in Javascript, it however allows you to define functions with XSLT itself: XSLT 2.0 is supported by XSLT 2.0 processors like Saxon 9, AltovaXML Tools or XQSharp

If you want to use Javascript to define extension functions we need to know which XSLT processor you use, of those three XSLT 2.0 processors I mentioned I think only AltovaXML Tools allows that (, and only, I think, to allow easier migration of XSLT 1.0 stylesheets written for Microsoft MSXML.

If you want to use an XSLT 1.0 processor then there too defining extension functions in a particular programming language like Javascript depends on the processor you use, for MSXML there is an msxsl:script element:

Embedded extension functions in other language is not the content model of XSLT.

Extension elements and extension functions are part of the content model as described in : it's implementation dependant how exactly an XSLT processor register those extensions.

As pointed by @Martin Honnen's answer, in XSLT 2.0 you can declare "stylesheet functions" with XSLT itself.

Need Your Help

Allow user to copy image from picturebox and save it everywhere

c# image clipboard copy-paste

In my application I have a pictureBox that shows an image. When user right clicks on the pictureBox and selects Copy from the context menu, I want to copy the image into the clipboard so the user can

Unable to use curl despite it appears enabled

php curl command-line cmd xampp

I am using xampp on Windows 8 ,curl appears to be enabled in my PHP configuration but still when I write this in cmd

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.