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

XSLT: Check if a node is found in a nodelist

I need to check if a particular value is there in a node list. For now I am using for-each and I think this is not efficient. and
Kangkan
  • 15,267
  • 10
  • 70
  • 113
3
votes
3 answers

XSLT 2.0 Xpath error "not a node item"

my first post here - sure hope someone will know the answer! I have been able to find solutions for many issues I had, but not for this one. The questions and answers on this site on the same subject did not solve my issue... I have an xml…
Maestro13
  • 3,656
  • 8
  • 42
  • 72
3
votes
2 answers

Doing a double-pass in XSL?

Is it possible to store the output of an XSL transformation in some sort of variable and then perform an additional transformation on the variable's contents? (All in one XSL file) (XSLT-2.0 Preferred)
deken
  • 387
  • 2
  • 3
  • 12
3
votes
2 answers

XSLT2 for-each-group: is there a way to reference sequence of representative elements?

Inside a for-each-group statement in XSLT2 the focus changes to a set of representative elements, one from each group. This means that, for example, last() returns the number of groups (because that equals the number of representative elements, and…
David R
  • 994
  • 1
  • 11
  • 27
3
votes
4 answers

How do I find the number of elements in a using XSLT?

I have an XML schema that contains the following type : A sample XML fragment would be: 1 2 3.2 5.6 In an XSLT transform, how do I get the number…
Abelson
  • 99
  • 1
  • 7
3
votes
3 answers

xslt sort output xml

I'm trying to find a solution to the following problem. I'm developing XSLT transformation (which is now about 40KB big) that is transforming quite complex XMLs into a quite simple structure which would like this:
Lukasz
  • 7,572
  • 4
  • 41
  • 50
3
votes
2 answers

Ant xslt task output to stdout

Using the task in ant, how do I get the output to generate to stdout? My XSLT is generating multiple files through xsl:result-document and the normal output is just status information that I'd like to show up with normal Ant output. Ant…
Harold Putman
  • 1,231
  • 1
  • 10
  • 12
3
votes
3 answers

how to sort values with XSLT?

I have an XML similar to this: TypeA value1 TypeB value2 TypeA value3 where the values are…
deken
  • 387
  • 2
  • 3
  • 12
3
votes
2 answers

How to use xsl:sort with foreign characters (i.e., 'æ', 'ø' and 'å')

I'm trying to sort a list by the name of each element. Example: Title One Another Title Å Another Title Ø Yet Another Title The output of this using the original sort-function will result in something like this: Another Title Title One Å Another…
pecka85
  • 752
  • 7
  • 21
3
votes
2 answers

Comparing 2 node sets based on attribute sequence

I'm trying to build up a kind of library XML, comparing various nodes and combining them for later reuse. The logic should be fairly straightforward, if the tag_XX attribute value sequence of a given language is equal to the tag_YY attribute value…
Wokoman
  • 1,089
  • 2
  • 13
  • 30
3
votes
1 answer

How check string starts with number, period(.) and space in XSLT

I want to check string starts with number, period(.) and space. For doing that I used regex but that not gives the correct answer. Input: 1. this a paragaraph1 12. this a paragaraph2 this a…
user_v12
  • 559
  • 5
  • 15
3
votes
1 answer

Output minimized tags from XSL transform using XSLT 2.0

I'm transforming an XML document with mimimized br tags like this:
I'm using Saxon 9, and outputting as XHTML I was under the impression from the docs that when using…
Joel
  • 29,538
  • 35
  • 110
  • 138
3
votes
5 answers

How to force errors on a without "select" attribute?

If I use without specifying a value, the transformer assumes that the value is an empty string. In other words, if I forgot to specify a value (e.g. ), the compiler doesn't signal an error. This may cause my program…
NorvayHais
  • 601
  • 1
  • 7
  • 10
3
votes
1 answer