.NET 3.5 doesn't completely support XPATH 2.0 or XSLT 2.0, which is just too bad. Does anyone know if these two will be included and fully supported in any future .NET versions?
-
http://www.codeproject.com/Articles/24766/Using-Saxon-XSL-2-0-and-XQuery-1-0-in-NET The Java saxon library implements XSL 2.0 and XQuery 1.0. Using IKVM and GNU Classpath, you can get access to this library in .NET. However the interfaces for using Saxon are very different to the ones that you use in .NET. From this article page you can download interface adapters which help bridge the gap between the Saxon interface and the .NET XslCompiledTransform. This in turns makes it much easier to port code from using .NET XSL 1.0 to Saxon XSL 2.0. – gls123 Jan 10 '13 at 13:45
-
4You can post this feature request at [uservoice](http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3795831-native-support-for-xpath-2-0-or-xslt-2-0-in-net) by Microsoft – Binoj Antony Mar 29 '13 at 15:36
5 Answers
I don't think they'll add support for XPath 2.0 or XSLT 2.0 any time soon.
However, you shouldn't feel bad if these are not part of the BCL, as long as you have 3rd party implementations available:
- Saxon: XPath 3.1, XQuery 3.1, XSLT 3.0
- XmlPrime: XPath 3.1, XQuery 3.1, XSLT 2.0
- QueryMachine: XPath 2.0, XQuery 1.0
- Lightweight XPath2 for .NET: XPath 2.0
- Exselt: XSLT 3.0
Microsoft is customer oriented. If customers don't want it, they won't make it.
2009-11-18: I contacted the XML team here and got this response:
While XML continues to be a key part of our platform going forward, we have decided not to pursue an XSLT 2.0 implementation at this time. If there is a specific XSLT task you’re trying to accomplish and are having difficulty with XSLT 1.0, please let us know and we’ll do our best to help.
This list is now maintained at github.com/maxtoroq/dotnet-xml

- 28,282
- 11
- 76
- 114
-
23They initially promised implementation - that's the reason why there are only few implementations because when big company like Microsoft says we will do it and we will give it to everyone as part of Windows there is no reason to program it. But then MS lost several key people in the XML Team and since then 2.0 support is dead. – CodeRipper Apr 20 '10 at 19:57
-
6That answer looks eerily familiar - I asked a similar question a few years back and got the same answer. Shame - XSLT 2.0 looks like a rather important improvement to language usability. – Eamon Nerbonne Jan 10 '11 at 18:51
-
Lightweight XPath2 for .NET is now at https://github.com/StefH/XPath2.Net – rakensi Sep 22 '16 at 14:42
-
1The real problem is that none of those 3rd party options have been updated to run on .NET Standard/Core -- and several are based on JKVM which means they _can't_ be updated. Considering how many 3rd party commercial products you've linked to there, I'm not sure the "customer oriented" line explains anything.. – Jaykul Mar 30 '17 at 15:11
-
@Jaykul It's only a problem if you embrace .NET Core. XSLT is very niche, and Microsoft likes to please a large/broad market with general purpose tools. – Max Toro Mar 30 '17 at 16:16
-
2If they were truly customer oriented, they'd do it. This is one of the most upvoted issues in their UserVoice. Everyone is begging for it. XSLT is not niche, it's taught in most Information Systems classes. It's a fundamental data interchange format. – alirobe Oct 19 '17 at 20:52
-
1@alirobe The people *not* voting for it are even more. It only proves how passionate people who like XSLT are. Many things taught in schools are rarely used in the real world. – Max Toro Oct 25 '17 at 15:18
-
2FYI: .Net Core Feature Request: https://github.com/dotnet/corefx/issues/2295 for XPath/XSLT v2 & 3 support. – JohnLBevan Oct 27 '17 at 15:39
See this blog post
There are several reasons why we aren't implementing XSLT 2.0 and XPath 2.0
It takes a lot of effort and resources to implement all 3 technologies (XQuery, XSLT 2.0 & XPath 2.0). Our guiding principle was that we believe creating a proliferation of XML query technologies is confusing to end users. We'd rather implement one more language that we push people to learn than have to support and explain three more XML query and transformation languages, in addition to XPath 1.0 & XSLT 1.0 which already exist in the .NET Framework. Having our customers and support people have to deal with the complexity of 3 sophisticated XML query languages two of which are look similar but behave quite differently in the case of XPath 2.0 and XQuery seemed to us not to be that beneficial.

- 72,212
- 42
- 129
- 156
-
13That's from 5 years ago from a blog titled "Why You Won't See XSLT 2.0 or XPath 2.0 in the *Next* Version of the .NET Framework" (my emphasis) – Brian Agnew Oct 06 '09 at 12:36
-
1Thanks! Didn't notice that! Unaccepted this answer again, hoping for a newer explanation. (Although it is a good explanation so the +1 stays.) – Wim ten Brink Oct 06 '09 at 19:53
-
Nothing has really changed since then; it's the last communication on that subject, sadly. – Pavel Minaev Oct 07 '09 at 17:46
-
3That said, there are two things worth keeping in mind when dealing with XSLT in .NET: 1) it supports exslt:node-set(), which covers one of the big advantages of XSLT 2.0, and 2) msxsl:script lets you define arbitrarily complex functions directly within your XSLT using C#/VB/JScript.NET, without mucking with extensibility APIs. Since `XslCompiledTransform` uses `XPathNavigator` for node representation, and the latter fully implements XDM, you can actually implement all XPath2 functionality (like operators `<<` and `>>`) as custom functions on top of that. – Pavel Minaev Oct 07 '09 at 17:49
-
1It is not the last communication on the subject. E.g.: http://blogs.msdn.com/xmlteam/archive/2007/01/29/xslt-2-0.aspx – thorn0 Oct 15 '09 at 17:42
-
11
-
@thorn the link is dead, http://web.archive.org/web/20100118203004/http://blogs.msdn.com/xmlteam/archive/2007/01/29/xslt-2-0.aspx (cached version from 2009) – Peter Feb 08 '16 at 14:48
-
2016 - XML is still alive, but Microsoft doesn't fully support XPath and XSLT 2.0 – Vladislav Aug 11 '16 at 11:23
-
2017: This is the third company in my career as a software developer, where I would have appreciated XSLT2.0 support by .NET. I guess, they will never support it.
– Hermann Schachner Jan 10 '17 at 16:52 -
-
Here is an updated url for the referenced blog post: https://learn.microsoft.com/en-us/archive/blogs/dareobasanjo/why-you-wont-see-xslt-2-0-or-xpath-2-0-in-the-next-version-of-the-net-framework – Jon Jan 25 '23 at 15:50
My understanding is that many Microsoft XML resources were diverted from XSLT 2.0 onto LINQ to XML, which - in my view - doesn't address the same problem-space as XSLT at all.
LINQ to XSD was supposed to enhance LINQ to XML (as well as XML Schema benefits, the syntax is less ugly), but this was open-sourced by Microsoft onto CodePlex some time ago and appears to have no community support.
Also, its unlikely that Microsoft would launch a new XSLT 2.0 processor without an XSLT 2.0 editor and debugger integrated into Visual Studio, so quite a bit of effort/time would be required to reverse their 'non-adoption' decision. [Update] There's now an XSLT 3.0 extension for Microsoft VSCode (managed by myself) that integrates with Saxon's 3.0 XSLT processor.
So instead we have Saxon.NET, which has an unimpeachable standards compliance reputation and provides excellent extensibility options for .NET.

- 2,087
- 1
- 22
- 27
Microsoft have no plans to release support for XPath/XSLT 2.0 in .NET.
XQSharp provides a 3rd party implementation of XPath 2.0, XSLT 2.0 and XQuery for .NET.
[edit: XQSharp 2.0 beta (with XSLT 2.0) has been released]

- 4,242
- 1
- 24
- 30
-
@Oliver-Hallam: Is this forecast still valid? Are you on track? – Dimitre Novatchev Sep 04 '10 at 16:29
-
@Oliver-Hallam: Will XQSharp-XSLT 2.0 be faster than Saxon.NET? – Dimitre Novatchev Sep 04 '10 at 16:31
-
@Dimitre-Novatchev - Funny you ask now; we should have a beta version of our XSLT implementation released in the next few hours! As for speed we believe our performance to be as good as Saxon, although we are biased so we would love an independent opinion! – Oliver Hallam Sep 06 '10 at 13:19
-
1
I can't believe they won't be at some stage since they're core W3C technologies. However I can't find any current reference to these (only info posted a long time ago).
For the near future you should take a look at Saxon which supports the Xpath/XSLT versions you require.

- 268,207
- 37
- 334
- 440
-
I would use AltovaXML instead: http://www.altova.com/altovaxml.html It's free and supports Java, .NET and WIN32 through COM. It's just that I hoped .NET would support it natively. – Wim ten Brink Oct 06 '09 at 13:59
-
1AltovaXML API is useless, plus it's native code, while Saxon is managed. – Max Toro Oct 07 '09 at 17:34
-
1Altova big problem is that they refuse to implement correctly white space only text nodes preserving. – Mar 24 '11 at 02:36