End tag 'head' does not match the start tag 'meta'. Error processing resource

please find me a solution:

  i used xml,xsl useing php.

i get the error :End tag ‘head’ does not match the start tag ‘meta’. Error processing resource

my xml codeing:
<?xml version=‘1.0’?>

<catalog>
<cd title=“D’Amore et des Mots” artist=“Sylvestre, Anne” genre=“cultural”>
<track id=“1”>Allez-y Doux</track>
<track id=“2”>Faites-moi Souffrir</track>
<track id=“3”>Tango pour Luce</track>
<track id=“4”>Au Bord des Larmes</track>
</cd>
<cd title=“Romantic Sonatas and Serenades” artist=“various” genre=“classical”>
<track id=“1”>Nocturne for Strings</track>
<track id=“2”>Symphonic Dance No. 2</track>
<track id=“3”>Brandenburg Concerto No. 1 in F</track>
<track id=“4”>Concerto for Two Trumpets</track>
<track id=“5”>Piano Sonata No. 26 in E-Flat</track>
</cd>
<cd title=“Ricky Martin” artist=“Martin, Ricky” genre=“cultural”>
<track id=“1”>Fuego Contra Fuego</track>
<track id=“2”>Dime que Me Quieres</track>
<track id=“3”>Vuelo</track>
<track id=“4”>Comingo Nadie Puede</track>
</cd>
<cd title=“No Pads, No Helmets” artist=“Simple Plan” genre=“rock”>
<track id=“1”>I’d Do Anything</track>
<track id=“2”>The Worst Day Ever</track>
<track id=“3”>I’m Just a Kid</track>
<track id=“4”>Meet You There</track>
<track id=“5”>One Day</track>
<track id=“6”>Perfect</track>
</cd>
</catalog>

xsl codeing:

<xsl:stylesheet version = ‘1.0’ xmlns:xsl=‘http://www.w3.org/1999/XSL/Transform’>

<xsl:template match=“/”>
<html>
<body>
<table width=“80%” border=“1” cellpadding=“2” cellspacing=“2” align=“center” >
<tr><th colspan=“2”>
<head>
<h1>My CD Collection</h1>
</head>
</th></tr>
<xsl:apply-templates /><!-- apply the other templates here –>
</table>
</body>
</html>
</xsl:template>

<xsl:template match=“cd”>
<tr><td valign=“top”>
<p><b>Title: </b> <xsl:value-of select=“@title” /> <br />
<b>Artist: </b> <xsl:value-of select=“@artist” /> <br />
<b>Genre: </b> <xsl:value-of select=“@genre” /> <br />
</p><!-- display attribute values for title, artist, genre –>
</td><td valign=“top”>
<p><xsl:apply-templates select=“track” /></p>
<!-- apply the track template here –>
</td>
</tr>
</xsl:template>

<xsl:template match=“track”>
<xsl:value-of select=“@id” />)<!-- select and display track ID –>
<i>
<xsl:value-of select=“.” /> <!-- display text in element –>
</i><br />
</xsl:template>

</xsl:stylesheet>

php codeing:

$xml = implode(“”,file(“c:\xml3.xml”));
$xsl = implode(“”,file(“c:\xml3.xsl”));
$arguments = array(
‘/_xml’ => $xml,
‘/_xsl’ => $xsl
);

$xh = xslt_create();

$result = xslt_process($xh, ‘arg:/_xml’, ‘arg:/_xsl’, NULL, $arguments);
if ($result) {

 echo $result;



 $create_xml = fopen($xml_file,"w");

fwrite($create_xml,“$result”);
fclose($create_xml);

}
else {

echo xslt_error($xh).“<br />”;
echo xslt_errno($xh);
}
xslt_free($xh);

please ,awiating for your replies…

I think you coded something wrong here :
your post :
<html>
<body>
<table width=“80%” border=“1” cellpadding=“2” cellspacing=“2” align=“center” >
<tr><th colspan=“2”>
<head>
<h1>My CD Collection</h1>
</head>
</th></tr>
<xsl:apply-templates /><!-- apply the other templates here –>
</table>
</body>
</html>

Should be :
<html>
<head>
<title>
My CD Collection
</title>
</head>
<body>
<table width=“80%” border=“1” cellpadding=“2” cellspacing=“2” align=“center” >
<tr><th colspan=“2”>
</th></tr>
<xsl:apply-templates /><!-- apply the other templates here –>
</table>
</body>
</html>

check then!!! I hope it helps

hello sinapra
i tried with ur codeing but still it gives me the same answer.pls reply me
thank you

I think the problem might be that you are not passing any ‘normal’ head data ie: meta …

If you are not using it for anything, delete the head tags altogether.

Might work

hi Cyril,
sorry to reply late, I am not realy sure where its going wrong. As Spike has suggested, either there should be using meta tags to specify file types, etc, or may be remove the head tags altogether to check the result.
I havenot worked with XSL and XML inclusions in my projects, still I try my best to help you.