1

TD;LR:

No matter the XSL and XML file, it seems that XSL transformations don't work on Chrome 71 but work on Firefox for instance.


For the sake of example, I have two files (that I borrowed from W3School):

simple.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="simple.xsl"?>
<catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
  </cd>
</catalog>

and simple.xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" indent="yes"
  doctype-public="-//W3C//DTD HTML 4.01//EN"
  doctype-system="http://www.w3.org/TR/html4/strict.dtd"
/>
<xsl:template match="/">
  <html>
  <body>
    <h1>Music Collection:</h1>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Title</th>
        <th>Artist</th>
      </tr>
      <tr>
        <td><xsl:value-of select="catalog/cd/title" /></td>
        <td><xsl:value-of select="catalog/cd/artist" /></td>
      </tr>
    </table> 
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

When I run on Firefox, it works fine, but on Chrome I have a blank page with this error in the console (that I don't get on Firefox):

Unsafe attempt to load URL file:///[...]/simple.xsl from frame with URL file:///[...]/simple.xml. 'file:' URLs are treated as unique security origins.

Is Chrome even able to run XSL tranformations? I find it strange because the W3School snippets work well on this browser, but when I copy and paste the code and run the code on my computer it doesn't work. What should I do?

Thank you for your help.

JacopoStanchi
  • 1,962
  • 5
  • 33
  • 61

0 Answers0