Possible Duplicate:
How can I make XSLT work in chrome?
I have this XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
<catalog>
<album>
<title>Exodus</title>
<artist>Bob Marley</artist>
<country>Jamaica</country>
<price>19,99</price>
</album>
<album>
<title>Black Album</title>
<artist>Metallica</artist>
<country>USA</country>
<price>20,00</price>
</album>
<album>
<title>Nevermind</title>
<artist>Nirvana</artist>
<country>USA</country>
<price>22,00</price>
</album>
</catalog>
which links to this XSL file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Catalog</h2>
<table border="1">
<tr bgcolor="#9ACD32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/album">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
When I open the XML file in a browser, I don’t see anything being displayed. Since I copied from a tutorial as instructed, I’m not sure what went wrong here. Do you have any clue in terms of what may be causing the lack of display?
Depending on XSLT constraints of the browser you use you may see nothing.
I tested your files locally using Chrome 19.0.1084.46 and Firefox 3.6.22.
In Firefox I could view it with no problems, but in Chrome I saw nothing.
When I opened the console tab at developer tools in Chrome it show this message:
Then, I started my Tomcat and deployed the 2 files and when I accessed the xml from Chrome voilà, it shows everything as expected.
I’m guessing that you are accessing it using file:/// and this is related to this issue Bug 397894