Link to home
Start Free TrialLog in
Avatar of ethar turky
ethar turkyFlag for Saudi Arabia

asked on

call javascript function from within xslt

Dear all,
  Need to call JavaScript function ( ex:isSQL(oNode)  and pass the current Node to it using xslt 2

  Thanks
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

For that you need an extension function.
You have a potential issue
- the only XSLT processor that supports javascript extension function is Microsoft XSL
- microsoft does not support XSLT2

Using Saxon (only XSLT2 processor currently fit for production) you can only use extension functions with the Professional Edition
(which means you need to purchase license)
and you will need to wrap the javascript function in a java class
(or just rewrite that function in Java)

Saxon does have an experimental SQL library you can find on their website (in the samples package)
www.saxonica.com with the downloads
Avatar of ethar turky

ASKER

I have no problem with Microsoft XSL
I will change to xslt1( hence I am in proof of concept level )
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
google for
microsoft xsl javascript extension
and you will find lots of interesting examples (and pitfalls)