Questions tagged [xslt-2.0]

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

XSL Transformations version 2.0, the successor to XSLT 1.0. It introduces the following features:

  • xsl:function: user defined functions that can be invoked from within XPath expressions

  • XPath extension mechanism: a formal means of invoking methods written in other languages from within an XSLT expression

  • unparsed-text-available(): checking a URL to insure that it returns text content

  • unparsed-text(): loading non-XML content into an XSLT transformation

  • Sequences: collections of atomic data types or XML objects

  • Date/Time API: functions to manipulate date formats

  • Numeric iterations: expressions that facilitate loops without recursion

  • xsl:analyze-string: text processing of a string based on a regular expression

  • xsl:next-match: allows multiple template rules to be applied to the same source node

  • xsl:result-document: send output to a file or web service

  • xsl:for-each-group: allows nodes to be organized and referenced as a group

  • Inline control keywords: XQuery extensions for iterating and conditional statements in XPath

  • xsl:character-map: map entities to some output form, to replace disable-output-escaping

  • tunnel attribute: allows pass-through of a parameter to a nested template which depends on it

There are several standalone XSLT 2.0 processors, including:

Online Training Courses

Books available online

See also:

  • Saxon CE is an implementation of XSLT 2.0 that runs in any modern browser; it includes extensions that provide declarative handling of user interaction events.

News: As of June 8th 2017, XSLT 3.0 is a Recommendation of the W3C Consortium and therefore the latest version of XSLT.


4654 questions
25
votes
2 answers

Will XPath 2.0 and/or XSLT 2.0 be implemented in PHP?

The question was asked but deleted by the asker before it received an answer. Because I believe the question is sound and legitimate and serves a purpose, I'm asking it again and provide the answer I already wrote for the original question. Will…
Abel
  • 56,041
  • 24
  • 146
  • 247
22
votes
1 answer

Need variable value as element name using XSLT

I am converting one format of XML to another and I need to insert an element and name it with the value of a variable. For example, I am trying the statements below using XSLT, but I am getting an error from the processor saying that the element…
Bhuvana
  • 241
  • 1
  • 2
  • 5
21
votes
4 answers

Open-source java XSLT 2.0 implementation?

I'm currently looking into using XSLT 2.0, but I cannot find any open-source java implementations (Saxon-B seems to fit the bill, but isn't schema-aware). Am I missing something?
otto.poellath
  • 4,129
  • 6
  • 45
  • 60
19
votes
1 answer

To compare two elements(string type) in XSLT?

i am new to XSLT ,can any one please suggest to me how to compare two elements coming from xml as string their values are: Vision Operations --XML code 90 Fifth Avenue --XML code
Vineet
  • 5,029
  • 10
  • 29
  • 34
19
votes
2 answers

How to show page number (N of N) using xslt in PDF Report

I am using XSLT to generate PDF report. My requirements are to display page number in the format of Page N of N (e.g.Page 1 of 3) at the footer of the report. For static values it works fine and it repeats on each page. As total number of pages in…
naeemgik
  • 2,232
  • 4
  • 25
  • 47
18
votes
2 answers

How to update the variable value in xslt?

I have declared a variable in my .xsl file. Now I want to update the older value with new value. For example:
Saravanan
  • 11,372
  • 43
  • 143
  • 213
17
votes
4 answers

How to get maximum value under same node in xslt

I have a xml like below : HourlyReport 8 1 1
CodeGuru
  • 2,722
  • 6
  • 36
  • 52
16
votes
2 answers

What is the current state of XSLT 2.0 availability within .NET

The latest I can find from the web and blogosphere indicate that Microsoft's XML team would be supporting XSLT 2.0 (now that it was a full blown W3C recommendation). I can't find anything beyond that. What's the current status? Is it available in…
Jay Stevens
  • 5,863
  • 9
  • 44
  • 67
16
votes
4 answers

How can I calculate the absolute value of a number in XSLT?

I have DifferenceInDays has a value that can be a negative or a positive number, I want to display its absolute value. How can I do this?
Mithil
  • 3,700
  • 12
  • 30
  • 41
16
votes
7 answers

Use saxon with python

I need to process XSLT using python, currently I'm using lxml which only support XSLT 1, now I need to process XSLT 2 is there any way to use saxon XSLT processor with python?
Maliq
  • 315
  • 1
  • 3
  • 11
15
votes
2 answers

adding attribute to the node

I am trying to add an attribute to the node if the child node value is equal to some string. I have a main.xml file 32 1 ABC
atif
  • 1,137
  • 7
  • 22
  • 35
15
votes
3 answers

How to group and sum values in XSLT

For each "agency" node I need to find the "stmt" elements that have the same key1, key2, key3 values and output just one "stmt" node with the "comm" and "prem" values summed together. For any "stmt" elements within that "agency" that don't match any…
johkar
  • 435
  • 3
  • 8
  • 12
14
votes
2 answers

List of XSLT instructions/functions that change the context node?

Does anyone know of a list of XSLT instructions/functions that change the context node? For example, instruction like for-each is one of them.
Pacerier
  • 86,231
  • 106
  • 366
  • 634
14
votes
5 answers

How to convert ticks into a readable datetime with XSLT?

I have an XML with timestamps like this: And I would like to display them in the result HTML as date with time. Is there a way to do it with XSLT (any Version)? EDIT: I am using XSLT2.0 with Saxon9. The base date is…
MrFox
  • 3,233
  • 6
  • 25
  • 27
14
votes
1 answer

Upgrade PHP XSLT processor to XSLT 2.0

Is it possible/easy to upgrade PHP's library to use XSLT 2.0? Current set up: xsl XSL enabled libxslt Version 1.1.24 libxslt compiled against libxml Version 2.6.32 EXSLT enabled libexslt Version 1.1.24
Louis W
  • 3,166
  • 6
  • 46
  • 76