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
1 answer

Saxon XSLT 2.0 lookahead pattern?

I know that lookahead pattern is not allowed in XSLT with saxon, but I need to know how I can use this regular expression in XSLT 2.0: where x and y are numbers. Any suggestions please?
3
votes
2 answers

Use xslt:analyze-string to add acronyms to HTML

I want to add acronyms to an HTML text using xslt:analyze-string. The problem: in my HTML text are tags such as some text that are treated as XML nodes. When I apply xslt:analyze-string these nodes are converted to strings - the…
Suidu
  • 75
  • 1
  • 4
3
votes
1 answer

xsl:sequence vs xsl:value-of in function which is better to use

In example of functions as i see there is use of xsl:sequence when i change this with xsl:value-of it gives same result, what is the benefits of using xsl:sequence rather than xsl:value-of.
Rupesh_Kr
  • 3,395
  • 2
  • 17
  • 32
3
votes
1 answer

Do xslt 2.0 processors optimize selecting only the first item in a sequence?

For example, with the input document: and the stylesheet:
yas
  • 3,520
  • 4
  • 25
  • 38
3
votes
2 answers

How to sort XML entries that contain numbers but sometimes also contain letters?

I have these id values that I want to have sorted:
3
votes
1 answer

Remove extra group level using XSLT

I need to remove the extra group level in my generated output. My requirements is that, I need to split the data in element for every 10 characters. My code is almost working but it populated an extra group level . Here is my XML…
3
votes
2 answers

Dynamic doctype in XSLT transform (correct use of result-document instruction)

I'm using XSLT and need to generate the doctype dynamically in the transformed output, based on a parameter. I hear that this cann't be done using XSLT 1.0, but can with version 2.0, using the result-document tag. So far, from following the answer…
Joel
  • 29,538
  • 35
  • 110
  • 138
3
votes
1 answer

XSLT- normalize non-breaking whitespace characters

I have a sample xml file like this,

text1 text2

text1 text2

text1 text2   

this sample xml, first

has space whitespace character ( ), second

has tab whitespace whitespace character…

sanjay
  • 1,020
  • 1
  • 16
  • 38
3
votes
3 answers

XSL to find all nodes between nodes

I have a large poorly formed XML file where information related to a single line item is broken into multiple lines of information that I'm trying to group with the parent line item (ITEM_ID). The information is sequential so the key is the ITEM_ID…
Rey
  • 43
  • 1
  • 4
3
votes
1 answer

Alphanumeric sort on mixed string value revisited

Note that I posed a very similar question earlier but the requirements have since changed Alphanumeric sort on mixed string value The primary difference in the requirements now is that the source XML can include forms with all alpha chars in the…
johkar
  • 311
  • 1
  • 3
  • 13
3
votes
1 answer

xslt support in go

Dear fellow go enthusiasts, I would need xslt support in a go program. As far as I know there will be no xslt library in the the near future and currently there is no binding to a xslt library in go. What is the FASTEST library on linux or cross…
mrsteve
  • 4,082
  • 1
  • 26
  • 63
3
votes
1 answer

How to fix some broken tags

I have some broken tags in my input that I like to fix in my xslt. I have searched and tried different things, but I can't seem to figure it out. Input:

Some text broken tag

3
votes
2 answers

XSL:FO avoid Space between Table Cells

Hello guy I have two table Cells and a in both Cells. How can i avoid to get a space between the two Cells. It's not possible to span the two cells. I use Antennahouse and XSLT 2.0 . Here is my Code for the table
Elrond
  • 479
  • 1
  • 8
  • 21
3
votes
1 answer

Relative space between region-before and region-body in FOP xslt

I'm trying to get a 10mm space between region-before and region-body. But I'm not able to get it relativ to the size of regin-before. Thats how the border should be. With a single-lined 'Bemerkung' it works. But as soon as it gets double- or…
3
votes
1 answer

Namespaces are removed on Reading an XSLT in a TextArea

I have following StyleSheet information in a XSLT file located in my project directory, am reading this file and storing it inside a TextArea in HTML and then later i read the Textarea using javascript. When i read the Text Area in IE9+ browsers…
user2918673
  • 141
  • 1
  • 9