---
title: "How to run XSLT from the command line"
source: https://dev.pageseeder.com/get_started/tutorials/how_to_run_xslt_from_the_command_line.html
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~554
---

# How to run XSLT from the command line

| Property | Value |
| --- | --- |
| Skills required | XML |
| Time required (minutes) | 15 |
| Intended audience | Developer |
| Difficulty | Easy |
| Category | Document |

## Objective

[XSLT](https://www.w3.org/TR/xslt20/) is a programming language from the World Wide Web Consortium (W3C). The primary design objective of XSLT is to transform the content and structure of XML documents to a non-XML syntax such as plain text or HTML, or from one XML structure to another. This tutorial shows how to process an XSLT transformation using the Windows command line.

## Prerequisites

To complete this tutorial requires:

- Software to read and write zip files (e.g. **7-Zip** or on Windows right-click Extract all/Send to Compressed).
- Access to the command prompt on a local computer (on Windows run `cmd`);
- A decent text editing program such as **Notepad++**, **Sublime** or something other than Windows Notepad, which has problems with the line endings.
- The sample files for this tutorial are available on [GitHub](https://github.com/pageseeder/pageseeder-tutorials/tree/master/converting_xml_to_psml)

## Tutorial

### Installing an XSLT processor

To interpret and run XSLT code requires an XSLT processor. The steps below will install the Saxon XSLT processor on Windows.

- If it is not already present, install Java as follows:

1. Go to [https://www.oracle.com/java](https://www.oracle.com/java) and choose Java SE download.
2. Download the JDK or JRE .exe for windows (x64 for 64 bit) and run it.

- Go to [https://www.saxonica.com](https://www.saxonica.com/), download the latest SaxonHE `.zip` file and unzip the contents to:

```
c:\saxon
```

### Run the XSLT code

- Create a data folder  (e.g. `c:\ps\films`) on the computer and copy to it:


  - the input XML file (`wikipediafilms.xml`)
  - the XSLT code file (`films.xsl`)
- Open a command prompt in the data folder (e.g. c:\\ps\\films) and use Saxon to process the XML with the XSLT code. For example:

```
> java -jar c:\saxon\saxon-he-12.5.jar -s:wikipediafilms.xml -xsl:films.xsl -o:myoutput.xml
```

Open the output `.psml` files in the data folder using a text editor to check the content.

