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

How to do XSLT 2.0 transformation with C#

Is it possible to use XSLT 2.0 transformation with native .net framework ? I know it's possible with XSLT 1.0.
Bob
  • 1,011
  • 3
  • 12
  • 28
7
votes
2 answers

How to Import stylesheets in xslt conditionally?

Is there any way to import stylesheets after checking some conditions? Like,if the value of variable $a="1" then import 1.xsl or else import 2.xsl.
Senthil
  • 71
  • 1
  • 2
7
votes
2 answers

Idiomatic way to express set equality in XPath 2.0

If $A and $B are sequences, what is the idiomatically preferred way of testing $A and $B for set equality? I know the existential semantics behavior of ($A = $B) makes this expression not the answer. The ordering semantics of deep-equal() prohibit…
Cary Millsap
  • 806
  • 6
  • 17
7
votes
1 answer

How to include an XSL file into another?

I use XSLT Version 2.0 and I want to include a head template head.xsl in another file home.xsl. home.xsl :
Sami Li
  • 181
  • 1
  • 1
  • 9
7
votes
2 answers

how to align text and table data into center in xsl

i am trying to put my data and table into the center of page as shown in below table. but i have done only the table stuff remaining data alignments and adjustments i am not able to do, as i am not familiar with xsl. and here is my xsl code :
preeth
  • 365
  • 3
  • 7
  • 20
7
votes
1 answer

In XSLT 2.0, why is there no fn:decode-for-uri?

I have a URI encoded string in XML but can't decode it using xslt. There is a fn:encode-for-uri to encode the string But no decode-for-uri to decode. Is there a function I have missed? If not, why does it not exist?
Rob
  • 1,235
  • 2
  • 19
  • 44
7
votes
1 answer

Create custom XSLT function

I am trying to create a custom XSLT function, but every time I receive this error: 'The first argument to the non-static Java function 'compareCI' is not a valid object reference.'
javagc
  • 133
  • 6
  • 13
7
votes
2 answers

What does this do? and

I am very new to XSL and I am confused about what the select inside the following pieces of code will select. Any ideas? Thanks
Cristy
  • 547
  • 4
  • 7
  • 20
7
votes
2 answers

How to handle duplicate imports in XSLT?

A warning is thrown whenever the same file is imported multiple times in an XSL transformation. Usually something along the lines of Stylesheet module…
Riplikash
  • 843
  • 8
  • 27
6
votes
3 answers

Assign to after thedecleration

I am using the below way to assign value to a variable. After the assignment I want to assign new value to the same variable. Like…
Varun
  • 426
  • 3
  • 7
  • 18
6
votes
1 answer

Returning QNames from user-defined function

I am trying to transform a WSDL definition into another format for further processing, but I ran into a problem. I can't seem to return QName-values from a function, without them being turned into a string. I reduced the file to the following, while…
Markus Jarderot
  • 86,735
  • 21
  • 136
  • 138
6
votes
1 answer

Using XSLT to translate an XML file

I want to translate a given XML file (it is a RelaxNG grammar) to other languages via XSLT. Suppose the XML file is: Now I was…
topskip
  • 16,207
  • 15
  • 67
  • 99
6
votes
2 answers

XSLT2: How to reference attributes about the current node in XPath2 predicates

I had posted another question with this as one aspect of it. I was told to clarify the question, but that question was already pretty long and complicated, so I created a new one. I want to know if there is standard way of referencing the current…
David R
  • 994
  • 1
  • 11
  • 27
6
votes
1 answer

How to get line number in XSLT?

Is it possible to get the line number when we apply XSLT to an XML? I need to know the line number when there is a particular template match found in the XML. Is it possible to retrieve the line number?
senthil kumar
  • 119
  • 2
  • 4
6
votes
3 answers

XML to XML Mapping using XSLT

I am new to XSLT and trying to map one XML to another XML using xslt, here is my first XML a Admin Manager
Umesh Awasthi
  • 23,407
  • 37
  • 132
  • 204