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
4
votes
2 answers

Group Adjacent Functionality in XSLT

I have a question about the use of group-adjacent. I have seen two patterns being used: Pattern 1: Pattern 2:
4
votes
3 answers

Use XSLT to mark up text matching regex?

I am trying to use XSLT 2.0 (Saxon-PE 9.6) on an HTML document to create tags that surround all contiguous runs of characters from a specified non-Latin Unicode block (spaces allowed). I need to apply this process to every text() node in the…
keithm
  • 2,813
  • 3
  • 31
  • 38
4
votes
2 answers

Why modern web browsers don't support XSLT 2.0?

We are thinking to use Altova StyleVision. We can create a good report template with it. Altova's default browser shows our work very well. However, generated XSLT files are not supported by the modern web browser. Any suggestions?
Harun ERGUL
  • 5,770
  • 5
  • 53
  • 62
4
votes
2 answers

Is there a way to use mode in an xsl:if test?

I've been learning to use the mode attribute with XSLT and was wondering if there's a way to test for it within a template, such as in an xsl:if statement? I've only seen it used at the xsl:template level and maybe that's the only way. Say I want to…
slugger415
  • 361
  • 1
  • 3
  • 11
4
votes
3 answers

XSLT - find position() when inside a nested for-each

I'm using XSLT to perform a transformation on some fairly complex XML. In order to achieve the output I need to, I've had to create a nested for loop something like the following: Source XML
danw
  • 1,608
  • 4
  • 29
  • 48
4
votes
5 answers

Meaning of "context" in regard to parameters of a calling template

I like to think that I have a good grasp of XSLT, but the following eludes me: Why is an xsl:param not accessible from a called template that does not explicitly declare it? In other words, if I call template B from template A: Stylesheet…
Mathias Müller
  • 22,203
  • 13
  • 58
  • 75
4
votes
1 answer

Split large xml file with xslt 2.0

I have this source xml file. USVa USVb USV10 .... The element…
user3123034
  • 45
  • 1
  • 4
4
votes
2 answers

XSLT: A sequence of more than one item is not allowed as the first argument of concat()

I am trying to generate a pagelist which consists of a concatenation of the id of various divs (@chapter)|(@part). My problem stems from nested structures: @part can contain any number of @chapter. I only want to select the id of the last ancestor…
user2093335
  • 197
  • 1
  • 2
  • 12
4
votes
1 answer

xslt 2.0 compare current date to start and end date

I have the following output:
2013-12-09 2014-01-05
I would like to test to see if current date is equal or greater to "start" and lesser or equal to "end" How…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
4
votes
3 answers

xslt 2.0 how to round number? 1.45632 => 1.46

How to round number in xslt 2.0 So for example it will work like this: 1.4367 => 1.44 1.3218 => 1.32
VextoR
  • 5,087
  • 22
  • 74
  • 109
4
votes
2 answers

How to handle Error in XPath 2.0 expression Division by zero

I had the below line of code which when I had been using xslt 1.0 gave no problem but in 2.0 it gave me the error XPath 2.0 expression Division by zero Is there some way this can be…
Enzero
  • 1,141
  • 2
  • 17
  • 36
4
votes
1 answer

check for successively numbered attributes

I have a situation where I need to check for attribute values that may be successively numbered and input a dash between the start and end values. The ideal output…
Jeff
  • 877
  • 2
  • 11
  • 17
4
votes
2 answers

Using XSLT 2.0 to parse the values of multiple attributes into an array-like structure

I'd like to be able to select all the attributes of a certain type in a document (for example, //@arch) and then take that node set and parse the values out into second node set. When I say "parse", in specific I mean I want to turn a node set like…
jrhooker
  • 1,373
  • 2
  • 11
  • 14
4
votes
1 answer

xsl sum siblings based on node value

I need to apply an xsl transformation that sums certain node values based on the value of one of its sibling nodes. Here's my xml pseudo code:
4
votes
3 answers

How to count the number of same immediate preceding siblings in xsl

I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input:
skoll
  • 232
  • 1
  • 2
  • 9