Run an XSL transform in your browser
XSLT turns XML into something else: an HTML report, a differently shaped XML document, or plain text like CSV. Testing a stylesheet usually means running a command-line processor or a build step after every change. This XSL transform page runs it live: edit the XML on the left or the stylesheet on the right and the output updates as you type.
Two processors
When your browser provides the standard XSLTProcessor API, it is used, and the status bar reads Transformed with the browser XSLT processor (html output) or similar. If the API is missing or fails, a compact XSLT 1.0 interpreter built into the page takes over and the message says "built-in" instead. Browser processors implement XSLT 1.0, so XSLT 2.0 and 3.0 features such as xsl:for-each-group or xsl:function are not supported. They need a processor such as Saxon.
Example: XML to CSV with method="text"
Left editor:
<orders>
<order id="7" total="19.50"/>
<order id="8" total="5.00"/>
</orders>
Right editor:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">id,total<xsl:text>
</xsl:text>
<xsl:for-each select="orders/order">
<xsl:value-of select="concat(@id, ',', @total)"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Output:
id,total
7,19.50
8,5.00
Note the <xsl:text>
</xsl:text> for line breaks: whitespace-only text between instructions is ignored in a stylesheet, so newlines must be written explicitly. The same pattern produces SQL INSERT statements, fixed-width reports or Markdown tables.
Output methods
xsl:output method | What you get |
|---|---|
html | HTML markup in the Code tab plus a rendered Preview tab. |
xml | An XML document, formatted with the Indent you choose. |
text | Plain text only: CSV, SQL statements, Markdown, configuration lines. |
| (not set) | HTML if the result's root element is <html>, otherwise XML. |
The Sample uses method="html": it sorts the books by price with <xsl:sort select="price" data-type="number"/> and renders them as a table you can see in the Preview tab.
What the built-in processor covers
The fallback interpreter handles the everyday XSLT 1.0 toolkit: template matching with modes and priorities, apply-templates, call-template with parameters, for-each, value-of, if, choose, xsl:sort, variable and param, element, attribute, copy, copy-of and attribute value templates like href="{@url}". An instruction it does not know inside a template stops with a clear message such as xsl:for-each-group is not supported by the built-in XSLT processor. Top-level declarations other than templates, variables, parameters and xsl:output are skipped without a message, including xsl:import, xsl:include, xsl:strip-space and xsl:key, and xsl:number always writes plain decimal numbers, whatever its format says.
Troubleshooting
- "Paste the XML document in the left editor" – one of the two editors is empty.
- Invalid XSL – the stylesheet itself must be well-formed XML; the error names the line and column.
- Empty output – usually a namespace mismatch. If the source has a default namespace, declare it with a prefix in the stylesheet and use that prefix in
matchandselect. - Only text, no tags – no template matched, so XSLT's built-in rules copied the text content. Check your
matchpatterns.
To debug a select expression on its own, try it in the XPath tester. If you just need a quick conversion without writing a stylesheet, XML to CSV and XML to HTML do it with no XSLT at all.
Privacy
Both documents are transformed in your browser and are not uploaded. Only Save & Share sends them to our server, to create a shareable link.