Questions tagged [xslt-3.0]

Use this tag for questions specific to XSL Transformations version 3.0 and no other version.


News: Since June 8th, 2017, XSLT 3.0 is a W3C Recommendation, implemented by Saxon since the release 9.8 the same week and subsequently by the releases Saxon 9.9 and Saxon 10.8 on the Java and .NET framework platform as well as by the now stable Saxon 11.5 release now available as Saxon Java 11.5 for Java, SaxonC 11.5 for C++/C, Python, PHP and as SaxonCS 11.5 for the .NET Core 6 or 7 platform and finally since 2023 in the latest Saxon 12.0 releases for Java (HE, PE, EE), C/C++, PHP, Python (SaxonC 12.0 HE, PE, EE as well as PyPi packages saxonche, saxoncpe, saxonche). XSLT 3.0 is also largely (except streaming) implemented by the current release of Altova (XMLSpy, Raptor version since 2017 release 3 or any later release).


XSLT 3.0 introduces the following new features via elements, attributes, and expressions:

References

XSLT 3 processors

  • Saxon 9.8, 9.9, 10, 11, 12 by Saxonica, exists in the free, open-source HE edition and the commercial PE and EE editions, for 9.8 all editions are available for Java or .NET framework or C/C++, the current stable releases 10.8 and 11.5 are available for Java and .NET framework; Saxon 11.5 also for as SaxonC 11.5 for C/C++/PHP/Python. The 9.9 release Java has been cross-compiled as Saxon-C 1.2 for C/C++ with bindings to be used as a PHP extension and as a Python 3 module. The latest stable Saxon releases 10 and 11 available for Java and C/C++/Python/PHP as well as via SaxonCS for .NET 5/6/7 make xsl:evaluate and functions expressions and higher-order functions available in all editions. The newest release in 2022 was Saxon 11, the first for .NET Core 5 or .NET 6, using an XSLT 3.0 based transpiler approach to convert the Java code base into C# code to be compiled and built for .NET Core 5. Unfortunately SaxonCS 11 is currently only available as the EE edition. The C/C++/Python/PHP SaxonC 11.5 and the latest Java Saxon 11.5 release have been published in February 2023. The newest release is 12.0 available since January 2023 for Java, .NET 6/7 as SaxonCS, SaxonC for C/C++/PHP/Python as well as on PyPi.org for Python 3.
  • Altova Raptor, Altova XMLSpy (the XSLT 3.0 implementation in Altova products supports the W3C recommendations of XSLT 3.0 and XPath 3.1, except streaming in XSLT 3)
  • Saxon-JS 2 is available for Node.js (npm install saxon-js, npm install xslt3) and the browser
  • Saxon HE 11 Java has also been successfully cross-compiled with the latest IKVM to .NET 6 to be usable from .NET 6 or 7 code

Online Editors

XSLT 3.0 support in editors and IDEs

Tuturials


Online Training

"What's New in XSLT 3.0: Part 1" -- A Pluralsight video-course (5.5h), by Dimitre Novatchev

"The Evolution of XPath: What’s New in XPath 3.0" -- A Pluralsight video-course (4.5h), by Dimitre Novatchev


731 questions
2
votes
1 answer

XSL won't write xmlns:xsl?

How do I write the XSL namespace in my output? I'm using XSL to analyze an XSL document and report problems it finds, including copying the node. The problem is that I can't get xmlns:xsl="http://www.w3.org/1999/XSL/Transform" written into the…
JSmart523
  • 2,069
  • 1
  • 7
  • 17
2
votes
1 answer

How can I tell if the XSLT 3.0 that I've writting is actually streaming the XML?

Just what it says on the tin. I'm new to XSLT 3.0. I'm excited to try it out because so much of my work involves relatively simple operations on huge XML files. I'm discovering that there are several requisites for XML to ACTUALLY stream, but I'm…
Matt
  • 775
  • 7
  • 24
2
votes
2 answers

Should an XSLT3 unnamed xsl:mode on-no-match behaviour be applied to an element that has no mode matched but a mode is specified on apply-templates?

This questions is simpler to describe by example rather than as text. With the following XML 1 2 If I run the following XSLT3
2
votes
1 answer

How are sequences spliced, and why is my variable's value a document node?

Look at the code below:
cmf41013
  • 107
  • 1
  • 9
2
votes
3 answers

What are the differences between xsl:template which has only name attribute and xsl:function

I find they both can be called with parameters and return xsl:value-of and xsl:sequence, but what are the differences? Under what circumstances one should be used instead of the other for better? Do they have a small performance issue when used a…
cmf41013
  • 107
  • 1
  • 9
2
votes
0 answers

How to use an integrated extension function from the command line with Saxon-HE

I am trying to use a custom integrated extension function with Saxon-HE 9.9.1.5 run from the command line. When making the call, I get an error that the function cannot be found (XPST0017: Cannot find a 0-argument function named…
2
votes
1 answer

Saxon-HE 9.9.1.5 stylesheet parameters not being set

Building a .NET VSTO application using Saxon-HE 9.9.1.5. Setting global stylesheet parameters for the XSLT 3.0 transformer is not working. I am passing a Dictionary of QName / XdmAtomicValue to no avail. The same XSLT works fine using Saxon-HE…
Andrew Tyson
  • 67
  • 1
  • 8
2
votes
1 answer

How to add a delimiter between each element in a for-each loop?

I am looping through each element in a list and outputting a certain value: This simply outputs a concatenation of the name node of property. I want to…
2
votes
2 answers

How to remove namespace prefix for specific xml element with XSLT?

I can successful remove namespace prefixes from all elements, but would just like to remove prefixes from specific elements I would like to remove the namespace prefix from the X509Data element:
kojo
  • 23
  • 3
2
votes
4 answers

Using fn:random-number-generator to produce random numbers more than once

I try to write a simple function to provide me with a random letter each time i call it but I have difficulties combining my idea with the concept of a functional programing approach. Some help along the way would be appreciated! The code I have…
2
votes
1 answer

XSLT: How to parse HTML embedded in XML tags

I came across situation where XML tag has HTML code that needs to be parsed in XSLT. Here is the XML sample: <p>This is a paragraph.</p><p>This is another paragraph.</p> I want the embedded…
Gajendra Bagali
  • 177
  • 1
  • 2
  • 12
2
votes
1 answer

Is tokenize($s) the same as tokenize($s, ' ')?

https://www.w3.org/TR/xpath-functions/#func-tokenize explains about the single argument version of tokenize: The one-argument form of this function splits the supplied string at whitespace boundaries. and then goes on to define or explain that…
Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
2
votes
0 answers

order groups returned by XQuery FLWOR group by clause in document order

Coming from an XSLT background I sometimes struggle to find the XQuery equivalent of some XSLT approach I am used to. This question is about how to order groups in document order, which XSLT 2/3 seems to do automatically while with XQuery the order…
Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
2
votes
1 answer

XML - XSLT - Using attribute from external xml document

So, I have this XML input document:
fobisthename
  • 165
  • 1
  • 10
2
votes
2 answers

Is it possible to transform XSLT code with another XSLT code (meta XSLT)?

I have several XSLT code files and I want to modify them to add some comments after functions or explaining them etc. So let's imagine I have 10 XSLT files and I want to transform them with additional comments for each function. The code will not…
Sojimanatsu
  • 619
  • 11
  • 28