I'm trying to create a xsl file for a xml, but in chrome it doesn't work.
I know, that chrome only support v1 from xsl (looking at w3school).
In firefox my code is working. Its only test code at the moment.
xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
hallo welt
</body>
</html>
Here is my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="trans.xsl"?>
<doc>
</doc>
I've looked for the same problem on the web, but haven't found anything that helps.
Are you testing this on a file: URL? In chrome I get this in the console:
Unsafe attempt to load URL file:///home/me/Downloads/XML/trans.xsl from frame with URL file:///home/me/Downloads/XML/test.xml. Domains, protocols and ports must match.
That looks like matching domains, protocols, and ports to me... Probably some other security-related feature blocking it. At least now you have an error message to google for.
Moral: when something breaks, use the browser console! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With