Testing xslt code using your browser

html, xml, xslt, xslt-1.0, xslt-2.0

Solution

A super-simple way to test your XSLT in a browser is to add the following header to your XML source document:

<?xml-stylesheet type="text/xsl" href="mystylesheet.xsl"?>

then load it (the XML source) in the browser.

Another option is to use a stand-alone HTML document with some javascript to load your XML and XSLT documents and initiate the transform.

None of these can really replace a dedicated application. Note also that you have tagged this with XSLT 2.0, but I don't know of any browser that supports it.

Problem

Using my browser, I want to test if my xslt code is working. Currently I am copy pasting my xml and xslt code into w3school's example page and test it there. However, this is a real pain, since inserting tabs don't work there, syntax highlighting isn't active and the output window is too small. It is inconvenient to test your code there in general. So: - What do I have to setup to test my xslt code? - Do I have to change the name of the xslt file to xhtml or html? - How do you test xslt code in general? I want to call the link `file://code.xslt` in my browser and see the result, for example. I am on Ubuntu, Linux. Testing with Chrome To circumvent chrome's same origin policy, I had to restart chrome with `google-chrome --allow-file-access-from-files`. Here and here is more info.

Original source

Related problems