7

Is it possible to use XSLT 2.0 transformation with native .net framework ?

I know it's possible with XSLT 1.0.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Bob
  • 1,011
  • 3
  • 12
  • 28

2 Answers2

3

There is no XSLT 2.0 processor offered by Microsoft.

An XSLT 2.0 processor that claims to be written especially to be used in .NET is XQSharp.

Another very popular XSLT 2.0 processor is Saxon 9.x, which, although written in Java, has a special .NET version.

Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
  • both are quite slow, so best is sticking to 1.0 atm :( – Jaster Mar 18 '11 at 13:45
  • 7
    @Jaster: I don't have much experience with XQSharp, but Saxon has been so optimized that I strongly disagree with such a statement. Also, people use XSLT 2.0 for its wealth of new features and a few milliseconds do not match in 99% of the cases. – Dimitre Novatchev Mar 18 '11 at 14:33
  • @Jaster: Any misused tool can be slow. –  Mar 18 '11 at 19:50
  • 1
    Don't blame me, just do some performance testing with xslt 1.0. Base .NET vs Saxon od XQSharp. It's not "some milliseconds". @Alejandro so using them for xslt is worng? Those tools intend to cook coffee? – Jaster Mar 21 '11 at 10:46
  • Just to add some data, in our case xslt 1.0 takes 450ms and saxon takes 750ms. – Benjamin Baumann Aug 26 '14 at 09:05
  • 1
    @BenjaminBaumann, I am sure that the same, written in Assembler, would take 20-30 ms. But XSLT 2.0 is already quite old. At present people are using XSLT 3.0 / XPath 3.0. Maybe in the three years since this reply was written, Saxon achieved even further optimization (to be found in its latest Saxon9.5.x processor). – Dimitre Novatchev Aug 27 '14 at 22:36
  • 1
    I totally agree Dimitre. I was just giving "real life" timings in case it could help people. Btw, the bench was done using Saxon 9.5 and the performance results were good from our point of view. – Benjamin Baumann Aug 29 '14 at 13:25
  • @BenjaminBaumann, it is good when testing Saxon to use the "repeat" argument with a value at least 3-4, otherwise the time is unrealistically bigger as it includes the time for loading the JVM (IKVM). – Dimitre Novatchev Aug 29 '14 at 14:07
2

I disagree that XQSharp (or for that matter Saxon) is slow. While neither currently compile to MSIL, both have good optimizers. I know from first-hand experience thatlarge grouping tasks can be faster with XQSharp than with XslCompiledTransform.

Tim
  • 69
  • 2