each time I try to display it in the browser I get the following error
"
XML Parsing Error: XML or text declaration not at start of entity
Location: file:///home/dankwansere/Desktop/movies.xml
Line Number 2, Column 1:<?xml -stylesheet href="movies.xsl" type="text/xsl" ?>
^
"
I don't know if the error is from the xml document or the xsl sheet. here are the codes;
movies.xml
<?xml version = "1.0"?> <?xml -stylesheet href="movies.xsl" type="text/xsl" ?> <collection> <movie> <title>Shawshank Redemptions</title> <year>1998</year> <genre>drama</genre> </movie> <movie> <title>Limitless</title> <year>2010</year> <genre>suspense</genre> </movie> <movie> <title>12 Angry Men</title> <year>1960</year> <genre>drama</genre> </movie> </collection>
movies.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="/collection"> <html> <body> <table border="1"> <tr> <th>Title</th> <th>Genre</th> <th>Year</th> </tr> <xsl:for-each select="movie"> <tr> <xsl:value-of select="title" /></td> <xsl:value-of select="year" /></td> <xsl:value-of select="genre" /></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>

New Topic/Question
Reply



MultiQuote




|