I can't get it done to add a DOCTYPE to my xml sitemap. W3C keeps showing an error that the doctype wasn't found (which is the only error). Further no errors, but whenever I put some doctype at the top of the document it creates a lot of errors, after revalidation. Probably because any doctype I can find is a XHTML or HTML doctype, can't find a XML doctype. Anyone who can help me out here?
Error from w3c:
No DOCTYPE found! Checking XML syntax only.
Builds the header of the xml file:
$header = '<'.'?'.'xml version="1.0" encoding="UTF-8"?'.'>'."\n";
$header .= "\t".'<urlset ';
$header .= 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";
return $header;
xml sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.url.com/path</loc>
<priority>1.0</priority>
<changefreq>weekly</changefreq>
<lastmod>2015-06-05</lastmod>
</url>
</urlset>
EDIT:
Screenshot:
Got it done. I added an inline DTD as DOCTYPE which fixed the problem: