Extension:XSL

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
XSL
Release status: beta
Implementation Parser function
Description Applies XSL transformations to XML documents
Author(s) Greg Rundlett (GregRundletttalk)
Latest version 2.0.0 (2019-10-31)
MediaWiki 1.32+
Database changes No
License GNU General Public License 3.0 or later
Download
Translate the XSL extension if it is available at translatewiki.net
Check usage and version matrix.

The XSL extension performs an XSL transformation on XML documents. The purpose of the extension is to be able to re-use XML output from external systems. The parser function lets you take an XML document, apply an XSL transform and pull the resulting document into the wiki page. There are two optional parameters that allow you to enable wiki-text parsing of the document; and to enable/disable caching of the result.

Installation[edit]

  • Download and place the file(s) in a directory called XSL in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'XSL' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit]

{{#xsl: xsl |xml |parse=true |nocache=false }}
  • xsl - The URL of the stylesheet
  • xml - The URL of the XML document
  • parse - (optional) if enabled the output of the transformation will be parsed as wiki text
  • nocache - (optional) if enabled caching will be disabled for this page. Enable this to allow dynamic content