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

If "match" else

In XSLT I often match nodes using the following command which would get the nodes from
Jon
  • 3,174
  • 11
  • 39
  • 57
1
vote
1 answer

Trouble Inserting an element into xml using XSLT 2.0

I am receiving a soap message(XML) and after adding a new XML element i have to send it further to another service. Is it possible to add the element by using XSLT 2.0. If so then how? Input Message
omer khalid
  • 855
  • 1
  • 12
  • 39
1
vote
1 answer

Datatype Conversion in XSLT 2.0

I am performing XSLT transformation on some input XML which is generated from a FlatFile. I want to change the datatype of a element to "date" but without showing it in output XML. Input XML: 20141009 XSLT…
omer khalid
  • 855
  • 1
  • 12
  • 39
1
vote
2 answers

How to Convert String into decimal in XSLT 2.0 to last two Decimal places

I want to Convert a string value into decimal by using XSLT 2.0 to last two decimal places. I want to change the value of Country Code element to decimal.The input string length is fixed i.e 11. Input XML:
omer khalid
  • 855
  • 1
  • 12
  • 39
1
vote
1 answer

Suppress default attributes when using xsl:copy-of

I cannot figure out how to suppress the default attribute shape="rect" in an xhtml output document when using xsl:copy-of. Sample XML:

Table 7.2 Foo

user2093335
  • 197
  • 1
  • 2
  • 12
1
vote
1 answer

Select only one node to be processed

I'm noobie when it comes to programming with xpath or xslt. Im trying to select only specified node to be processed and in the process create folders for each element. Here's my test xml im working with: XML:
Artiom
  • 81
  • 12
1
vote
2 answers

XSLT functions to add comma (,) after certain number of words

I am stuck in a problem where I need to add commas in a string after certain words. For eg. the string is: String1 : My name is John Smith I have a bat its costs is $150 String2 : My name is Michael Dawson I have a bike its costs is $10000 To…
user2128585
  • 47
  • 2
  • 10
1
vote
3 answers

XSLT 2.0: "initialization"

Is there a way to "initialize" the sequence the xsl:number element produces? For instance if number will produce the following output: 1 1.1 1.1.1 I would like that initializing it to 2 for instance it will produce the following result: 2 2.1…
Vlax
  • 1,447
  • 1
  • 18
  • 24
1
vote
1 answer

apply-template matching only goes to default

I have a XSL file which does the matching of template rules in XSLT 2.0 just to check which template rule has higher priority. But it only goes to default one and not to others even if priority is set.You can see it live here:…
fscore
  • 2,567
  • 7
  • 40
  • 74
1
vote
1 answer

Xpath query over xslt variable

I'm finding a way to use the xpath preceding/preceding-sibling functions to count the number of tag over the iteration on multiple xml file. I'm using the 'collection' function to "merge" multiple xml, as below:
profires
  • 13
  • 2
1
vote
1 answer

XSLT 2.0 - Keep default element, remove duplicate siblings, filter unnecessary entries by attribute

Using XSLT 2.0. I need to filter all elements that have attribute @xml:lang where the attribute's values are not in a list of possible values I define. Ex allowable values: x-default,en,en-US,en-GB When @xml:lang is detected on any element, and if…
Jon L.
  • 2,292
  • 2
  • 19
  • 31
1
vote
0 answers

I want to check the input attribute value with the point tokenized value

I was trying to see if the input objectType and value0 exists in the Types/Type and check the condition and use the sibling attribute name value of the Types/Type in the output xml. Here is the input xml:
1
vote
2 answers

XML transform element appearing in wrong place in document

I am having some problems with an XML transform and need some help. The stylesheet should iterate through all suffix elements and place the contents without the suffix tag next to the last text node within its first ancestor quote-block element…
Mike
  • 260
  • 2
  • 9
1
vote
1 answer

I want to refactor, parse the xml values and compare them in xsl

Some of the elements in have an associated element in a . I was able to compare the object and title and get the output but couldn't output the desired output when there is a…
1
vote
1 answer

xslt: create a schedule

can someone tell me, how can I create a list of dates using xslt using a start- and end date and a parameter for the calculation period, so sth like the input 2014/01/01 2015/02/20
Willi Fischer
  • 455
  • 6
  • 21