I have got this strange problem.XSL is not working with xml.This is my xml and xsl code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xsl-stylesheet type= "text/xsl" href= "w3c.xsl"?>
<catalog>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
<title>Eros</title>
<artist>Eros Ramazzotti</artist>
<country>EU</country>
<company>BMG</company>
<price>9.90</price>
<year>1997</year>
</cd>
<cd>
<title>Romanza</title>
<artist>Andrea Bocelli</artist>
<country>EU</country>
<company>Polydor</company>
<price>10.80</price>
<year>1996</year>
</cd>
</catalog>
This is my xsl:
<?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 xmlns="http://www.w3.org/1999/xhtml">
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<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>
Note:
I took this code from W3C and hence it's a working one.I have googled a lot but couldn't find any working solution.I have used ie,firefox and chrome doesn't work in any of them.I have tested it in my remote server doesn't work either.The error I get is "This XML file does not appear to have any style information associated with it. The document tree is shown below.".The same error occurs.In the href I have tried all possible links from full path to just file name.I have also tried chrome with --allow-file-access-from-files but doesn't work.Please help me fix this.