How to use EXSLT in a visual studio environment

Can I use EXSLT functions in Visual Studio? I write and debug my xslt scripts in VS. What should I do to be able to use, for example. date: add () function? What should be a very simple script? Thanks a lot, Peter

+4
source share
2 answers

The last three versions of Visual Studio (2010, 2008, and 2005) use the XSLT.NET XslCompiledTransform processor . XslCompiledTransform does not implement any EXSLT function except common:node-set() - so here you are out of luck.

I don’t think there is a simple and natural way to use other XSLT processors in Visual Studio, and there might even be some trick to do this, in which case XSLT could not be debugged.

Finally, EXSLT usually provides a limited XSLT implementation of some EXSLT functions. This, of course, is much less powerful and convenient, but you can go along this route.

My personal recommendation is to start using XSLT 2.0 , which is much more powerful than XSLT 1.0, and very little is needed to use EXSLT in an XSLT 2.0 application.

Of course, VS does not support XSLT 2.0, but there are other great IDEs like oXygen, which, among other things, provide good XSLT 2.0 and XQuery debuggers.

Update . You can use a third-party implementation of EXSLT for XslCompiledTransform: MVP - XML ​​project EXSLT.NET module .

+2
source

You can also use the msxml: script tag to include your own functions in XSLT. This works great for simple functions, and can also be debugged in VS2005 and higher, for example.

 <msxml:script implements-prefix="user"> <![CDATA[ function toUpperCase(str) { return str.toUpperCase(); } ]]> </msxml:script> 
+1
source

Source: https://habr.com/ru/post/1346218/


All Articles