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

Embedded Youtube Video in an XSL file

So I have an XSL file and I'm wanted to have an embedded youtube video to display and play on the same page without taking me to youtube. I have the embedded code and I've tried to use the XSL embed template example. [NOTE: I have put in my values…
Arty
  • 819
  • 3
  • 13
  • 24
1
vote
1 answer

XSLT - passing xml document as a parameter from javascript

I am currently working on an application that takes two xml files and compares them with XSLT 2.0 called from Javascript. I am passing in parameters to the XSLT from my javascript like so: xsltProcessor.setParameter(null, "testParameter", "I AM A…
kevinh
  • 61
  • 7
1
vote
1 answer

XSLT parse document($file) before use in a key

I've got a stupid question. I am loading an external document, and then using it to add an attribute to a certain element in the main document. A bit like this:
rawtext
  • 33
  • 1
  • 7
1
vote
2 answers

How to use last() inside xsl:matching-substring?

Is there a way to determine if a xsl:matching-substring is the last() matching substring? Example data: 1 A 1 2 B 2 1 C 3 Example XSLT:
tohuwawohu
  • 13,268
  • 4
  • 42
  • 61
1
vote
1 answer

Remove the node of xml depending on another node id using XSL

I need an help regarding the XSL ,please find my xml below
1
vote
2 answers

Access attribute from within current-grouping-key() xslt

I have some xml with thousands of movie elements which can all have 1 or MORE director and writer elements, if a director or writer has the same name as another, as seen here, I add an @differentiator of birthyear, if they are NOT the same…
user3530461
  • 83
  • 2
  • 9
1
vote
3 answers

How to convert flat xml data to hierarchical data xml

I have to convert a flat xml to hierarchical xml. I have no idea for this task. Below is input for conversion. Input:-

Article Title

abc, pqr and xyz

here is…

LuvKS
  • 53
  • 7
1
vote
1 answer

How to get tag value from input XML where tag name is stored in a variable

My code was unable to return a value from the input XML. The variable name is mapped in a separate xml based on a string. Step 1: I need to extract the XML tag from the another mapping XML. (This I got it) Step 2: XML tag is saved in a variable and…
Hari
  • 397
  • 1
  • 9
  • 23
1
vote
1 answer

Dynamic cast in XSLT 2.0 or 3.0

I have this code to cast a string to a type determined at runtime:
Max Toro
  • 28,282
  • 11
  • 76
  • 114
1
vote
3 answers

Use a variable in XSLT select

I am trying to make a named template or function where I an pass in a node name and it will select that as the last level of a xpath expression. But all it returns is the string I pass in as a param. In the below example the value returned is…
Alex
  • 1,891
  • 3
  • 23
  • 39
1
vote
2 answers

XSLT compilation failure with camel-saxon

I am using Fuse 6.1 and camel 2.12 version for my project and facing following problem. I am trying to pass java.util.HashMap to my xslt and accessing map to retrieve bunch of values in my XSLT. For this i am constructing a map and placing it the in…
Mr9
  • 159
  • 4
  • 15
1
vote
1 answer

Alter the element, if particular element not found as its descendant

Please suggest. If element 'mfenced' does not have elements like 'munderover' or 'mfrac' as its descendant, then it needs to be changed to element 'mo'. Find the 'text1' and 'text2' text in the xml, in these area my code unable to change to…
Rudramuni TP
  • 1,268
  • 2
  • 16
  • 26
1
vote
1 answer

How do I remove trailing emdashes in XSLT?

i am working on a xslt 2.0 with replace function and trying to do a xml to text conversion. I am trying to drop an em-dash (—) from conversion if it is present at the end of an xml tag. e.g Hello World — should be output as Hello…
anurag
  • 137
  • 2
  • 11
1
vote
1 answer

Creating New Functions

I have some XSLT code that looks like this: `
user3530461
  • 83
  • 2
  • 9
1
vote
1 answer

How to select a section of XML using a prioritized list of values

I have an xml with several large sections of similar data. I want to be able to select one section based on a priority list and whether or notthe section exists. For example If section A exist only use A if it does not exist use B and so on but…
Alex
  • 1,891
  • 3
  • 23
  • 39
1 2 3
99
100