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

What is the proper way to test a namespace-qualitified attribute name in a xsl:if?

I am using xslt 2.0 to test the name of a namespace-qualitfied attribute inside a xsl:if. I have a solution working but I believe it is a weak one, being sensitive to the particular namespace prefix. See http://xsltransform.net/jyH9rMs/1 for a…
keithm
  • 2,813
  • 3
  • 31
  • 38
1
vote
2 answers

Group a number of template matches without a parent element in XSLT 2

I have a very unstructured XML document (taken from a Pandoc converted docx to docbook format) which I am trying to clean with XSLT. The format of the xml is like this;
labrunning
  • 25
  • 3
1
vote
1 answer

Using XSLT to recursively load relative XML files and apply transformation

I have a xml file whose structure looks like this:
ishan
  • 1,202
  • 5
  • 24
  • 44
1
vote
2 answers

How to run Saxon XSLT for all the files in the folder

I have list of files in the folder/subfolders. How to run a single XSLT to run all the files in the folder/subfolder. Is it possible in saxon command line? I have tried the below command but its not working: java -jar saxon9.jar -o:foldername…
VSe
  • 919
  • 2
  • 13
  • 29
1
vote
1 answer

XSLT 2.0 for-each-group, sum based on parent value

I have tried to get for-each-group to work without success in my xml, I want to group the areas in my refdes-tags ond calculate the sum of the prices per area. If I have several refdes with the same area under an item it does only count the first…
Uffe
  • 13
  • 4
1
vote
2 answers

Is it possible to transform a parsimonious XML to a full HTML table using XSLT 2.0?

VERY IMPORTANT NOTE: I am using QtXmlPattern (a not fully implemented XSLT 2.0 processor with a few bugs in what's implemented...) I have a well formed XML file with data defined in a four level array as in:
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
1
vote
2 answers

Add Space Before a tag if it is Present in XSLT

Iam creating styles using XSLT for my XML file. Here is my code:
1
vote
2 answers

XSL: adding a new element to all

I'm a newbie at XSL/XSLT. I'm trying to add a new element (datasources) to all users elements of this xml: r1 h1
1
vote
1 answer

Remove repeated string in xslt

I need to remove duplicate entries of a string or merge contents of a complex type element. I want to Change this into this format::
HeisenBerg
  • 127
  • 10
1
vote
1 answer

XSLT template not applying to newly-created elements

I am using XSLT 2.0. Inside a xsl:template (template-1), I use xsl:analyze-string to create new span elements with an xml:lang attribute. I have a second template (template-2) that adds a class attribute to elements that contain a xml:lang…
keithm
  • 2,813
  • 3
  • 31
  • 38
1
vote
2 answers

How to avoid ambiguous match for two different elements

Please suggest for avoid the Ambiguous template match for both 'mfrac' and 'msub' elements. Here scripts are coded to remove the 'Space1' text nodes which are present at first or second child of msub or mfrac with first text node first or second…
Rudramuni TP
  • 1,268
  • 2
  • 16
  • 26
1
vote
0 answers

How to transform xml using jdom2 and a xslt 2.0 stylesheet

Does anyone know what TransformerFactory I should use to transform xml using jdom2 and a XSLT 2.0 stylesheet?
R. Oosterholt
  • 7,720
  • 2
  • 53
  • 77
1
vote
1 answer

xsl:fo image displays as black box in only Google chrome

I am creating a pdf file using xsl:fo, Right now I am facing issue in Google chrome browser. While generating pdf file, the image in the pdf does not display. instead of image there a black box appear. I have type try all content-type for xsl:fo…
1
vote
3 answers

unable to match a pattern though declared

I've the below Sample XML. New1.065
This is content
user3872094
  • 3,269
  • 8
  • 33
  • 71
1
vote
2 answers

XSL: How can I sort a three digit, hyphen separated value?

Problem I'm trying to sort on the entire value of rule/@id where the value of @id is a three value, hyphenated string like this "1-10-12" or "10-15-2". I've tried converting to a number, and I've tried formatting the number, but no luck. The code…