Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saxon 9.x vs XQSharp vs AltovaXML for .net

I need XSLT 2.0 processor tool for use in .net 4.0. I found out that XSLT 2.0 is not supported by .net. Alternatives are 3rd party engines like Saxon 9.x or XQSharp. I need XSLT 2.0 support for a commercial production environment, where performance is very important. Questions:

  1. Saxon 9.x or XQSharp, which one do i have to choose?
  2. What are the pro's and con's of the two products?
  3. Are there another alternatives?
  4. What about AltovaXML compared to Saxon 9.x or XQSharp?
like image 426
MLewi Avatar asked Jun 24 '11 09:06

MLewi


3 Answers

In the last weeks I used XQSharp, Saxon 9.x and AltovaXml to rewrite my program from using Microsoft XSLT1 engine. Here my experiences:

AltovaXml

  • It is free (but free version is limited and doesn't come with source).
  • The website is ok, so that you can find what you need
  • The api is simple an easy to set up
  • Has api for many different languages
  • It uses COM, in other words, requires native code interop
  • It is the slowest of the engines that I used

XQSharp

  • .NET friendly
  • Throws good exceptions with good description
  • Faster then AltovaXml
  • It is not free and no source is provided

Saxon 9.x

  • Not friendly website, difficult to find the things you search
  • Created by Michael Kay (the editor of the W3C specification of the XSLT 2.0 language)
  • Fastest of the XSLT2 engines that I used
  • There's a limited open source edition, schema-aware and streaming come with non-free editions
  • Based on Java, but comes with a packaged IKVM port to .NET

For my specific XML and XSLT (XSLT1) translation performance comparison:

  1. 0,02 s Microsoft XSLT1 engine
  2. 0,45 s Saxon 9.x
  3. 0.60 s XQSharp (with OptimizationLevel.None)
  4. 0.90 s XQSharp (default setting)
  5. 1,20 s AltovaXml
like image 183
MLewi Avatar answered Nov 18 '22 07:11

MLewi


I'm an XQSharp developer, but I'll try to give an unbiased answer.

Both XQSharp and Saxon are good products. Each has high conformance to the standard and both aim for great performance. My best advice is to download trial editions and test with the sort of transformations you expect to run. We'd be interested to hear how you get on.

If you are running in a .NET environment, I would expect XQSharp to have a few advantages. Firstly, it is developed in .NET, while Saxon is developed in Java and uses IKVM to run on .NET. You might like to compare the Java and .NET editions of Saxon to determine whether this imposes a performance overhead.

XQSharp is intended to integrate well with classes from the .NET framework System.Xml and System.Xml.XPath namespaces. For example, the implementation makes use of XPathNavigators. You might find this familiarity helpful.

XQSharp implements and extends the feature found in XslCompiledTransform to call out to .NET from XSLT, which you may find useful.

See this list of implementations.

like image 4
Tim Avatar answered Nov 18 '22 07:11

Tim


Didn't find out how to reply to the above answer (which gave me some good hints), so I'll post it here: AltovaXML has changed their policy regarding the AltovaXML.dll. You can get a version for free, but it is lacking some features. So you are better of buying a license. It also seems like Altova has some memory issues as the program seems to stay working even after you have closed the connection.

Saxon has an odd try-before-you-buy policy. By this I mean that it is kinda odd that you get a thirty day test, but start/end date is moving 10 days or so (read more on the website for saxon). It also adds some text to your converted files. I don't like that as I want my converted files - even under test - to be correct so that I can see that it is possible to send the files forward into our systems. I hope this will change in later versions.

XQSharp - I have not tried this and so I cannot say much about it. When I am upgrading my service that is using XSLT2.0 I will give this library/helper a spin.

like image 1
Trond Avatar answered Nov 18 '22 07:11

Trond