My XML file does not work correctly now, but worked earlier.
An online validator provided this error:
Message : Invalid '[ "urlset"]' found.
I don't know what is wrong with this urlset
.
Here is syntax:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<? foreach ($nizkochastotki AS $data) { ?>
<url>
<loc>https://<?=$host?><?=$data['url']?></loc>
<lastmod><?=date('Y-m-d')?></lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<? }?>
</urlset>
Without seeing a schema and documentation regarding allowed PIs (
<? ... ?>
Processing Instructions), we cannot completely "correct" your file, but we can show you what it would take to make it well-formed:Note that a PI must have a target name the conforms to
that is, among other requirements, it must start with a letter or several of the listed characters.
Note also that a PI target must appear immediately after the
<?
– no whitespace may intercede:So, if you remove the space ahead of
foreach
, and then add whatever PI targets are allowed by the processing application (XXX
as a placeholder below), the following XML is now at least well-formed: