Creating translets with XSLT 2.0 - xslt

I found a post, please see the IBM formum post, where it says creating pre-compiled java classes (Translets) using Apache Xalan utility transforms XML files faster than just using XSLT.
I have been XSLT 2.0 but it is not working because Xalan only supports XSLT 1.0. The Saxon processor supports XSLT 2.0 but there is no utility to generate Translets.
Any suggestions?

The version of Xalan that compiles to bytecode translets is generally referred to as XSLTC. We did some recent performance measurements of Saxon-EE performance against XSLTC, which we reported at XML London 2014 (our paper is available at http://www.saxonica.com/papers/xmllondon-2014mhk.pdf) and the measurements we made are on Github at https://github.com/Saxonica/XT-Speedo. For the collection of tests we ran, Saxon-EE came out ahead by a whisker: as a crude summary, XSLTC ran a little faster on most tests, and Saxon-EE ran a lot faster on a few tests, so the results you get will depend very much on your workload. But the differences are a few percentage points, so it's very unlikely to really affect your ability to meet your project requirements. The productivity benefits of XSLT 2.0 over XSLT 1.0 are much more important for most projects than a 5% performance difference.

I think the Enterprise edition of Saxon 9.5 provides compilation to byte code, see the feature matrix http://www.saxonica.com/feature-matrix.html which says about that feature: "Available for both Java and .NET platforms, typically giving a 25% performance boost.".
As for IBM, it also has an XSLT 2.0 implementation available as part of Websphere, see http://www-03.ibm.com/software/products/en/xmlfp/, but I don't know whether it provides compilation of XSLT to Java classes or to Java byte code.

Related

WSO2 ESB 5.0.0: How to replace bundled old Saxon 9.4.0.4 with the latest 9.7.0.11 to get support of XSLT 3.0 and XPath 3.1 for XML transformation?

I have a question regarding WSO2, Enterprise Service Bus, version 5.0.0, on MS Windows 7.
Can I replace bundled old Saxon 9.4.0.4 with the latest 9.7.0.11 (to get support of XSLT 3.0 and XPath 3.1 for XML transformation)? The bundled Saxon is in ".\wso2esb-5.0.0.zip\wso2esb-5.0.0\lib\endorsed\saxon9he.jar". It is Saxon, Java version, Home Edition, version 9.4.0.4, if I am right. When I replace it with the latest Saxon, HE, 9.7.0.11, I get many Java Exceptions.
So, is it possible, recommended, supported... to replace bundled old Saxon with the new one and/or even with licensed PE or EE 9.7.n.n?
Thank You in advance, Stepan
In general when an application bundles a specific version of Saxon there is no way of telling whether you can substitute a different version of Saxon except by (a) consulting the documentation of the application (if you're lucky) or (b) trying it to see if it works.
If the application sticks to the most stable APIs in Saxon then it will probably work, but if it dives down deeper to achieve closer integration then it may well make itself dependent on something that changes between Saxon releases.
That could be the case here. It's not entirely clear, but the error message
failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom
could suggest that the application is attempting to instantiate the Saxon XPath engine using the JAXP search mechanism, which we withdrew in Saxon 9.6 for reasons explained here:
https://saxonica.plan.io/issues/1944

XSLT in SharePoint

As far as I know, SharePoint 2013 only supports XSLT 1.0.
What will be the destiny of XSLT in SharePoint 2016? IS it possible to deprecate XSLT? If the answer is yes, what is the alternative solution for server-side rendering?
I agree with Michael Kay that we shouldn't try to predict the future here, but if we rephrase your question to how you can use XSLT 2.0 with SharePoint, I think the question is valid enough ;).
That said, there apparently have been third parties that make XSLT 2.0 available from SharePoint. How that works exactly, I do not know, but this tool or toolset seems to offer you the possibility of XSLT 2.0 in Sharepoint and comes with a handy suggestion to update Visual Studio to make development easier.
Whether or not you can, or want to use Corasworks to get XSLT 2.0 working is a judgement I cannot make, of course. If you can somehow just use a native .NET XSLT 2.0 (or 3.0) processor, as far as I know, you can choose from XmlPrime, Saxonica and Exselt (disclaimer, I wrote the latter, and it is still in development).
Side note: Microsoft first claimed it would support XSLT 2.0 at some point, but stated later that it would not do so in the near future, and yet later that it would probably never do so and leave it to others to implement XSLT 2.0 in .NET. This logically leads to the same response on SharePoint and XSLT 2.0, but they are somewhere on the internet.

Where can I find static/dynamic code analysis tools for XSLT?

Are there any static or dynamic code analysis tools that analyze XSLT/XSL code?
The resources I have been able to find so far are:
1. Oxygen xml editor
2. http://gandhimukul.tripod.com/xslt/xslquality.html which looks faily basic in its capabilities
There are quite a few testing tools and verifiers at Tony Graham's XSLT Testing Tools page. If you haven't looked there, it's a fairly comprehensive list.
Using Saxon in schema-aware mode will catch many common errors.
You've already discovered Mukul Gandhi's XSL Quality tools, which support user-added extensions. On the xsl-list run by Mulberry Technologies a while back, several other people contributed ideas for new rules also. You might also get help asking there.
Stylus Studio, Oxygen and xmlspy have profilers for run-time performance.
XML Spy includes an XSLT profiler. That should fulfil your dynamic analysis needs if you can afford it.
There is also StylusStudio, a plugin for VisualStudio and CatchXSL (which is free).

Which XSLT profiler should I use?

I'm in the market for an XSLT profiler.
I'm using the Xalan-j XSLT processor from Apache.
I'd like to be able to run the profiler under Windows or Linux as we have different teams using the same XML and XSLT on different platforms.
The tool needs to be able to work with exslt extensions.
The tool needs to be able to work with large (MB) input XML documents.
I'm not entirely adverse to paying for the right tool, but free (as in beer) would be nice.
I'm interested in hearing from people who have successfully used the tool that they recommend.
EDIT: updated, yes, xalan-j
I'm assuming you're talking about Xalan/J; I'm not aware of the options for Xalan/C++.
Stylus Studio had one in older versions, but it was dropped for Xalan in the current release.
The only other commercial one for Xalan that I am aware of that is any good is from Oxygen.
Note that sometimes switching on the profiler switches the XSLT engine into a debugging mode so that certain optimizations are not performed, so the profiler results should be taken with some common sense.
On-line XSLT processor based on xalan-2.7.1 with profiler information: http://xslt-profiler.appspot.com/

Are there any XSL Lint tools?

I'm looking for an XSL lint tool which is actively maintained. The only one I can find is this one, but the last update was in 2000 (9 years old!). Any help would be great!
Phillip,
Creating a good lint for xlst is quite hard, because validity of xslt templates depends on the parser that is used. Each parser has it own extensions.
For example java's xalan can be easily extended with custom xpath functions, which are obviously coded in java. Because of that any .net validator will fail to validate advance xalan's xslts.
So first of all you need to know what processor you are going to use. If you use java based processors I recommend to use Eclipse which can validate the templates on the fly.
I've tired two eclipse plugins, It is worth mentioning that both support debugging and xslt/xpath code completion:
Oxygen XML editor - a commercial (~$300) XML/XSLT editor/eclipse plugin.
It can use the following engines: Xalan, Saxon, Xsltproc,
It is able to check:
correctness of xsl:template
correctness of name attribute of xsl:call-template
duplicated definition of xslt variables
validity of dtd's
validity of xslt header
validity of xml namespaces
validity of XPath
validity of xsl:value-of if an xml is associated to xslt
correctness of xsl:import for local and remote files (it support xml catalogs)
I must say that the plugin is really good but on the other hand it isn't open source.
XSLT Project - an open source plugin (it is part of Eclipse Web Tools Platform).
It is quite young (started in September 2008), however it has very active community. Currently it supports only Xalan and JAXP.
It detects the following errors and warnings:
invalid xslt header
incorrect dtd
incorrect imports (it handle only relative imports, xml catalogs are planed for version
1.1)
The above list is definitely incomplete because lack of support for xml catalogs made this project unusable for me.
Yes, look at this one, published Dec. 2008:
http://lists.xml.org/archives/xml-dev/200812/msg00178.html
You should look for "XSL profiler" or "XSL debugger". There are dozens of these.