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

Replacing XPath Expression with Variable/Function

I have an XSLT 2.0 stylesheet. I need to perform a for-each-group loop, but the value I am grouping on may change, based on parameters passed into the stylesheet. For example, if my XML looks like this (simplified for this…
Mark Salamon
  • 569
  • 1
  • 8
  • 21
1
vote
3 answers

Flatten child elements nested within text nodes

There are a number of flattening questions here, but none deal with this level of complexity. I have an xml document that looks something like:
maybe some text node, maybe not...1
sgc
  • 45
  • 1
  • 7
1
vote
2 answers

converting xml to html table cannot get it right

New to xslt so go easy ,I am been trying to convert an xml to html via xslt and I cannot seem to get it right. Headers and rows should not be hardcoded and should be as generic as possible. Wanted result: Xml Used that I have no control over …
developer9969
  • 4,628
  • 6
  • 40
  • 88
1
vote
2 answers

NullPointerException in Saxon while parsing XSL

I am using Saxon PE 9.4 version. I am frequently getting an issue while parsing XSL but the issue is not consistent. Sometime it comes and sometime it doesn't come. Following is the stack trace: SEVERE: java.lang.NullPointerException at…
Nitesh Gupta
  • 215
  • 1
  • 11
1
vote
1 answer

XSLT dynamic element selection

I'm looking to dynamically print out elements which exist in a control list using only native XSLT2.0 functions. name
pdev84
  • 13
  • 2
1
vote
1 answer

Unable to match pattern using XSLT

I've below XML. This is first list item) This is second)
user3872094
  • 3,269
  • 8
  • 33
  • 71
1
vote
1 answer

Need sequence number based on the nesting of the element

Need sequence number based on the nesting of the element. In below example all the reference elements which is not child of any reference element will have sequence number, any nested reference element should have parent sequence number + decimal +…
Namrata
  • 13
  • 3
1
vote
2 answers

xpath concat function converts XML data into text

I am applying concat function of XPath 2.0 to concatenate two xml elements. It concatenates them but gives the output in text form. I am using XSLT for this transformation. Note: I have studied about it on internet, concat function by default…
Umair Khalid
  • 569
  • 1
  • 4
  • 24
1
vote
1 answer

Complex TSV to XML using XSLT

This is a follow-up question to a previous post. I'm working with a set of library catalog records (in MARC XML format), which I want to clean and enhance using a tool called OpenRefine. OpenRefine does not work very well with XML data, so I needed…
tat
  • 321
  • 1
  • 19
1
vote
2 answers

XSLT 2.0 --- Order of document collection()

I have a directory of multiple XML files to be merged. The files are named in the order they should be merged, such as: file1.xml, file2.xml, file3.xml ..the number of files varies. This code has worked in merging the files:
Paulb
  • 1,471
  • 2
  • 16
  • 39
1
vote
1 answer

Change the xml structure by grouping xml elements based on attribute

I have to regroup the xml elements in the same xml structure based on the attributes I have an xml like this test 1 test 2 test 3
chavsh
  • 11
  • 2
1
vote
2 answers

Replace value of one single node

let's say I have this input file foo bar 123 456 and I want this output:
Willi Fischer
  • 455
  • 6
  • 21
1
vote
1 answer

Get the text based on the following sibling

I've the below XML.
Mohamad B
user3872094
  • 3,269
  • 8
  • 33
  • 71
1
vote
1 answer

Using XSL to determine the state of a (pseudo) binary attribute

This morning I was working on implementing xsl-fo formatting for the xhtml tag. Typically you want citations to be italicized:
pgoetz
  • 848
  • 1
  • 8
  • 18
1
vote
1 answer

XLST Lookup Table returns false

I'm new to XSLT, but I have looked into this and I can't seem to get this working. I've got an xsl document and an external xml document. I'm importing the document as a variable $LOOKUP External XML