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
9
votes
5 answers

Preserving entity references when transforming XML with XSLT?

How can I preserve entity references when transforming XML with XSLT (2.0)? With all of the processors I've tried, the entity gets resolved by default. I can use xsl:character-map to handle the character entities, but what about text entities? For…
Daniel Haley
  • 51,389
  • 6
  • 69
  • 95
7
votes
1 answer

JSON serialization with XPath 3.1 fn:serialize

I am using XSLT 3.0 in Saxon-HE 9.8 and would like to work with JSON documents as linked data in JSON-LD. In JSON-LD, full HTTP URIs often appear as values. When I use the XPath 3.1 fn:serialize to round-trip the data back to JSON, the solidus…
tat
  • 321
  • 1
  • 19
6
votes
1 answer

XSLT3 can disable-output-escaping be used in same template as expand-text=yes?

I noticed when trying to use disable-output escaping in XSLT3 in Saxon that it would not work if expand-text was set to yes on the stylesheet or even on the given match template The following code (when run on itself) shows the issue (in Saxon…
6
votes
1 answer

How to use XSLT 3.0 from a Java application?

The general java code i use to process XSLT and XML files are : public static final String transformXmlDocument(String inputXmlString, File xsltFile) { TransformerFactory factory = TransformerFactory.newInstance(); …
Wilvasini
  • 163
  • 4
  • 19
6
votes
1 answer

XSLT 3.0 streaming (Saxon)

I have a big XML file (6 GB) with this kind of tree: E John Smith
steco
  • 1,303
  • 13
  • 16
5
votes
3 answers

XSLT3 Options for .NET Core in 2019

Has anyone got XSLT3 transforms working in .NET Core 2.x+ in 2019? Seems that the request to MS for XSLT2/3 support hasn't moved forwards, and the Saxon people have other priorities, especially given the IKVM closedown. Are there any other…
user426445
  • 364
  • 3
  • 15
4
votes
1 answer

Can a function defined by xsl:function substitute for an xpath 3.0 inline function?

I was playing with this example in the xpath 3.0 spec: fn:fold-left(function($a, $b) { $a + $b }, 0, 1 to 5) I tried to substitute the inline function with a function defined by xsl:function.
Fred Finkle
  • 1,947
  • 3
  • 18
  • 21
4
votes
1 answer

Grouping section of xml

I'm having some problems grouping a part of an input tree into a container element and leaving other parts intact. I am trying to use the for-each-group as an exercise. Logic: Process elements with template matches and try to detect when an element…
Zug_Bug
  • 186
  • 10
4
votes
3 answers

How to use XSLT 3.0 using Saxon-HE 9.8 in .NET

I'm using Win7 and set my VSC# project to .NETFramework4. Then download SaxonHE9-8-0-7N-setup.exe and install. Then reference saxon9he-api.dll to C# project and using Saxon.Api; And here's my program.cs: static void Main(string[] args) { var…
DaveG
  • 491
  • 1
  • 6
  • 19
4
votes
1 answer

Iterate over nodes containing CDATA and concatenate them and how to retrieve specific data of the concatenate data

I'm new to XSLT and need to solve a nasty problem and I've no change to solve it. The following example describes my problem: XXX123456123]]>
Dirk
  • 121
  • 1
  • 7
3
votes
1 answer

Any XPath/XSLT/XQuery 3.0 specific learning resources out there?

I'd prefer books. Do you know of any due to be released? Work ongoing? I ask as I want to get up to speed with the new features in 3.0 (I know its not finalized yet), but I can't seem to find much. I know I could ref the ongoing spec but if that…
Dino Fancellu
  • 1,974
  • 24
  • 33
3
votes
1 answer

XSLT 3.0 stylesheet compilation error with accumulator

I'm trying to transform my XML so I can easily convert it to JSON in a sap integration process. I'm getting a stylesheet compilation error and I cant figure out why. Here is my XML:
3
votes
3 answers

Parsing a URL query string into a map of parameters with XPath

What would be the most readable way to parse a URL query string into a { 'param': 'value' } map in XSLT/XPath 3.0? Note: this is the inverse function of the one described in Building a URL query string from a map of parameters with XPath. Update: I…
3
votes
1 answer

Creating xsl:result-document with xpath 3.1 fn:transform using saxon 9.9 EE

I'd like to create an output document using the xpath 3.1 fn:transform. Following is A.xsl. It creates A.xml when run directly (from oxygen):
Caroline
  • 167
  • 1
  • 11
3
votes
3 answers

Building a URL query string from a map of parameters with XPath

What would be the most readable way to build a URL query string from a { 'param': 'value' } map in XSLT/XPath 3.0?
1
2 3
48 49