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

How can I share match patterns between keys?

I have two keys with the same match pattern. The pattern is long. The pattern itself doesn't matter; the problem is the long duplication:
LarsH
  • 27,481
  • 8
  • 94
  • 152
4
votes
3 answers

how to convert xslt version 2.0 to version 1.0

i am using xslt document which uses xpath version 2 functions. I only have xalan 2.6 jar which has xslt 1.0 processor, its a constraint i cannot change it..please help me if there are any tools that convert xpath 2.0 functions to 1.0
dreambigcoder
  • 1,859
  • 4
  • 22
  • 32
4
votes
2 answers

Match the first occurrence of child node

I have an xml document Main Heading para 1 heading 2 para 2
atif
  • 1,137
  • 7
  • 22
  • 35
4
votes
3 answers

Repeat the first node from XML file using XSL

I'm at my wits end with this and wondering if this is even possible with XSL. Lets say that I have this XML data: Created By City John…
4
votes
1 answer

XSLT 2.0 library for C++

Are there any good XSLT libraries for C++ which support the 2.0 standard? I've found several libraries but all of them had no implementation for XSLT 2.0.
tuxtimo
  • 2,730
  • 20
  • 29
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
4
votes
1 answer

Split a node if it has certain children

UPDATE: I think I have answered most of this question now, except the handling of . you can see my updates and current XSLT at the end of this post under the EDIT I asked a similar question yesterday, and received good answers. However, I…
matchew
  • 19,195
  • 5
  • 44
  • 48
4
votes
1 answer

xsl template match a node with specific value

I am trying to filter the XML by what I get in a parameter. What is the correct sintax to match on only those courses that have dep_code equal to 'something' or in this case $department??? XML STRUCTURE IS
Cristy
  • 547
  • 4
  • 7
  • 20
4
votes
2 answers

xslt removing ending punctuation

I'm writing an xslt stylesheet to convert MARC-xml records into FGDC-xml metadata. A lot of the MARC fields have extraneous punctuation at the end (periods, colons, commas, etc.) which I would like to strip out. I don't want to remove all…
4
votes
2 answers

replace substrings using lookup table with xslt

I have a few strings containing a variant of Hexadecimal strings (source is framemaker if one would care). Strings could therefore look like this is some sentence with some hex code\x27 s , and we need that fixed. and will need to be changed…
Wokoman
  • 1,089
  • 2
  • 13
  • 30
4
votes
2 answers

When an item in a population doesn't match the "group-by" in an "for-each-group", can it be assigned to a group with an empty current-group-key()?

So I have input like: And a template instruction like: It would seem that I only get groups for foo…
David Bullock
  • 6,112
  • 3
  • 33
  • 43
4
votes
2 answers

Test if parameter is one of several values in XSLT

Possible Duplicate: XSLT expression to check if variable belongs to set of elements Given a parameter, $name, what is a short and clean way to check if its value is equal to one of a finite number of values? For example, say I wanted to merge the…
Svish
  • 152,914
  • 173
  • 462
  • 620
4
votes
1 answer

XSLT Going through array value

Here is variable: It can return multiple values, so in that case it will output something like: 2 21 36 =3…
VextoR
  • 5,087
  • 22
  • 74
  • 109
4
votes
3 answers

XSLT 2.0 Solution for Merging Sibling Elements With Same Name and Attribute Value

I am looking for a solution that will turn

aa bb cc Perhaps some text. dd ee Some more text. ff

Tench
  • 485
  • 3
  • 18
4
votes
2 answers

How do I match an element that has a certain sibling element in xslt/xpath

I'm trying to match all a/c elements that have a b sibling. I've tried: but I get "Cannot convert the expression {..} to a pattern" from Saxon. My XSLT/XPath skills are basic at best...
user533832