<?xml-stylesheet?> line show up
as raw XML with the message "This document cannot be formatted as intended". If you only want to
read one page, the XSLT Polyfill extension
is the quickest fix. If you want to see what the stylesheet produces, inspect it or fix it, use the viewer below.
More on the Chrome message.
What the viewer does
Renders the result
When the stylesheet produces an HTML page (output starting with <html>, <body> or a doctype), you see it rendered in a sandboxed frame, as a browser would have shown it.
Shows the source
One click switches to the generated markup, highlighted and formatted, ready to copy or compare.
Runs on a real processor
XSLT 1.0 on XSLTC, the same language browsers implemented; 2.0 and 3.0 on Saxon HE 12.9, which no browser ever had.
How to view an XML file through its stylesheet
- Find the stylesheet. Near the top of the XML file is a line like
<?xml-stylesheet type="text/xsl" href="report.xsl"?>. Thehrefis the stylesheet, usually next to the XML file on the same site. - Paste the stylesheet into the left pane of the viewer.
- Paste the XML into the input parameter. You can leave the
<?xml-stylesheet?>line in; it is ignored. - Read the result. An HTML page is shown rendered. Use the button above it to switch to the source.
An example
The viewer opens with this pair loaded. The XML:
<orders>
<order id="1" country="ES" total="120.50"/>
<order id="2" country="FR" total="80.00"/>
...
</orders>
and an XSLT 1.0 stylesheet that turns it into an HTML page with a table:
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<h1>Orders</h1>
<table border="1">
<tr><th>ID</th><th>Country</th><th>Total</th></tr>
<xsl:for-each select="orders/order">
<tr>
<td><xsl:value-of select="@id"/></td>
<td><xsl:value-of select="@country"/></td>
<td><xsl:value-of select="@total"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
The result pane shows the page rendered. Replace either side with your own files and it updates as you type.
When the result does not look like the original
- Missing images and CSS. Relative links in the output were relative to the original site. Make them absolute to see them.
- The stylesheet imports others.
xsl:includeandxsl:importwith relative paths point at files the viewer does not have. Paste their templates into the main stylesheet. - Scripts. JavaScript in the output does not run in the preview frame.
- Small differences from the browser. Browsers used their own XSLT 1.0 engine (libxslt in Chrome). XSLTC implements the same standard, but processor-specific extensions and output details can differ.
If the site is yours
Viewing the output is the first step of moving the transformation out of the browser, to the server or to build time. Check that it still produces what the browser showed, then follow Chrome removed XSLT: what to do. For a feed, read your RSS feed's stylesheet stopped rendering.
Also available
Want to know whether a stylesheet compiles before you look at its output? Use the XSLT validator →
XPath tester · XML to JSON · XSLT 2.0 · XSLT 3.0
Frequently Asked Questions
- How do I view an XML file with its XSL stylesheet?
- Open the XML file in a text editor and find the line that starts with <?xml-stylesheet; its href is the stylesheet's address. Open both files, paste the stylesheet into the left pane of XSLT Playground and the XML into the input parameter. If the result is an HTML page, it is shown rendered.
- Why does Chrome show my XML file as plain text now?
- Chrome 158, released on 17 November 2026, removed XSLT. Files that relied on an <?xml-stylesheet?> line to display themselves now show raw XML and the message "This document cannot be formatted as intended". The data is intact; the browser just no longer applies the stylesheet.
- Can I view XSLT output as HTML?
- Yes. When the output is an HTML page (it starts with <html>, <body> or a doctype) it is rendered in a sandboxed frame. A button above the result switches between the rendered page and its source.
- Why do images or styles not appear in the rendered output?
- Relative addresses in the output, such as images/logo.png or style.css, were relative to the original site. In the viewer they point nowhere. Make them absolute URLs to see them. JavaScript in the output does not run in the preview.
- Is the XSLT viewer free?
- Yes. No account and no installation. The transformation runs on our server and the result comes back to your browser.