XML XSL Transformer

Paste a document in one pane and an XSLT stylesheet in the other, and see the transformed result the moment either side changes.

XML
XSLT stylesheet
Transformed output
Runs locally in your browser

About the XML XSL Transformer

Testing an XSLT stylesheet normally means a command line processor, a build step or a Java classpath. Browsers already ship an XSLT 1.0 engine for styling XML, and this page exposes it directly. Your document goes in the left pane, the stylesheet in the right pane, and the result appears as soon as both parse, so you can tune a template and watch the output change on every keystroke.

Both inputs are checked for well-formedness first, which catches the most common mistake of all: a stylesheet missing the xmlns:xsl declaration or the version attribute on xsl:stylesheet. Compilation errors from the processor are surfaced as messages rather than a blank pane. The result is pretty printed when it parses as XML, and left untouched when your stylesheet uses method="text" or emits an HTML fragment.

The engine is XSLT 1.0, which is what every browser implements. Constructs added in 2.0 and 3.0, such as xsl:for-each-group, regular expression functions and typed sequences, will not compile here; use Saxon locally for those. Everything else, including xsl:key, named templates, modes, sorting and attribute value templates, works. For plain node selection without a stylesheet, the XPath Tester is quicker.

How to use

  1. Paste the source XML in the left pane.
  2. Paste your XSLT stylesheet in the right pane, including the xmlns:xsl namespace declaration.
  3. Read the transformed output below. Errors name the stage that failed.
  4. Copy or download the result, or keep editing the stylesheet and watch it update.

Common questions

Which XSLT version is supported?
XSLT 1.0, because that is what browser XSLT processors implement. XSLT 2.0 and 3.0 stylesheets will fail to compile.
Why do I get an empty result?
Usually no template matches the root of your document, or the match pattern uses a namespace prefix that is not declared in the stylesheet.
Can the stylesheet import another file?
No. Nothing is fetched from the network, so xsl:import and xsl:include of external files cannot resolve. Inline the templates you need.
Does it support output method text?
Yes. Text output is returned as it is, without the XML pretty printing step.