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

Convert negative decimal to hexadecimal in xslt

Please, can you help me how to convert negative/positive decimal value to hexadecimal in xslt/xslt 2.0 ? This is what i tried but does not work with negative numbers/decimals,
Hari
  • 397
  • 1
  • 9
  • 23
1
vote
1 answer

Compare the different line item fields and map the value which is in the same xml using xslt2.0

below one is the XML input,
002001454979 0000617944
1
vote
2 answers

XSLT 2.0: conditional formatting

I have a client that depending on the number of total nodes present wants to vary the format for a xsl:number element. For example if the total number of nodes < 101 then the format string is "01" so that 1 => will be displayed 01. If the total…
Vlax
  • 1,447
  • 1
  • 18
  • 24
1
vote
1 answer

How do i select all the text nodes within a specific element node using XSL?

How do i select all the text nodes within a specific element node using XSL? Input xml: Text node1 Text node2
user323719
  • 69
  • 6
1
vote
2 answers

Need to store local variables created in for-each that aren't a part of XML file

I'm using XSLT to convert 2 XML files into C code (XSLT 2.0). The goal is to generate the #include required for the .c file (could be many). There are 2 different places I need to look for the variable portion of the #include name: one can be read…
whoombat
  • 43
  • 4
1
vote
1 answer

Schematron - Element validation based on its position

I am using Schematron to do some business rule validations. My xml data looks like:
A J Qarshi
  • 2,772
  • 6
  • 37
  • 53
1
vote
1 answer

Throwing error in comparing preceding element

I've the below XML. [1.001] Arrest is for the pu [1.002] Brandon J said in [1.001] Singapore used to be and is still …
user3872094
  • 3,269
  • 8
  • 33
  • 71
1
vote
1 answer

What is the difference between as="element()+" and as="element()*" in XSL?

What is the difference between using as="element(data)+" and as="element(data)" in xsl:variable. The below XSL solution works if use "+" but not when i use "". Can some one clarify.
Rachel
  • 763
  • 14
  • 29
1
vote
0 answers

How to get a distinct collection of nodes in 2 separate parents using XSL 2.0

Hi I need to convert the following input xml to the below mentioned output xml using xsl 2.0 version. I'm pretty new to xslt and I've tried using apply-templates and for-each-group to get a distinct collection of clients. Input:
rani
  • 23
  • 3
1
vote
1 answer

max of a value calculated in for-each XSLT

I am calculating a max date @target_date_calc_end inside a for-each, but I have two nested for-each, and this is being a problem. As overview: I have this XML:
David Comino
  • 97
  • 1
  • 1
  • 5
1
vote
1 answer

How to convert XML elements to text

Please suggest how to convert XML elements with their name and content as escaped text (i.e., to <a>). XML: XSLT:
Rudramuni TP
  • 1,268
  • 2
  • 16
  • 26
1
vote
1 answer

using a counter for all groups members in for-each-group

I have a problem where I have an xml content with different keys needs to be grouped together and displayed, when displayed there is a pagination so I can't display all entries on the same page, I'm using for-each-group for grouping the items, and…
Shadi
  • 557
  • 1
  • 6
  • 15
1
vote
1 answer

making a transformed element the child of a sibling

I am doing a MODS to MODS transform on the following xml. I have greatly simplified it for clarity: Negatives (photographic) Cellulose nitrate…
jmignault
  • 13
  • 2
1
vote
1 answer

selecting all nodes with highest value for specific attribute

I am fairly new to XSLT so still learning the basics. In the following XML sample I am interested in selecting all the nodes with the highest number value for the attribute "Version": a
user2411083
  • 29
  • 1
  • 4
1
vote
1 answer

How to get repeated element from For-Each in XSLT 2.0

I want to get repeated elements in XSLT 2.0. But there is a restriction that i have to do that only with using "For-each" loop. Input…
user3141034
  • 161
  • 3
  • 5
  • 15