The opening tag for the sitemap is the following:
<?xml version="1.0" encoding="UTF-8"?>'."\n");
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
while the required one is simply:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
To notice that the used opening tag doesn't contain a closing quotation mark too (xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9).
Comments
Comment #1
avpadernoI didn't remove some characters that belong to the line that calls
fwrite().The currently used opening tag is the following:
Comment #2
dave reidThe missing closing quotation mark is by design, otherwise it will not properly validate.
Comment #3
avpadernoThen, the opening tag simply contains more data than the sitemap protocol suggests to use.
Comment #4
avpadernoThat is also true for the sitemap chunk opening tag.
Comment #5
Anonymous (not verified) commentedI'm not too concerned that too much information is in the tag. Can you give a sample of why this shouldn't be specified?
Comment #6
avpadernoCheck the sitemap protocol, and what the opening tag they use; as that is the official documentation, the format they report should be the followed one.
Comment #7
dave reid@Kiam/6:
Please see http://sitemaps.org/protocol.php#validating:
FYI, the example in the protocol is wrong, that's why we have the one line that doesn't end with a quotation.
Comment #8
avpadernohttp://sitemap.org/protocol.php clearly report the following example of sitemap:
Leaving out the missing quotation mark, which is not really missing, but it's present on the next line, the example uses an opening tag that is
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">. It doesn't add any other attribute, if not the one specifying the XML namespace.I changed the issue title, which is now focused on the extra data given, which are not necessary, nor mandatory, as reported from the sitemap protocol.
Comment #9
Anonymous (not verified) commentedRight, it is an example and not the only one to use.
Comment #10
Anonymous (not verified) commentedComment #11
avpadernoAlso Google Webmasters Tools reports the opening tag to require only the namespace attribute; I am not sure about Windows Live, but I think they report the same thing.
Comment #12
avpadernoSee also Manually creating a Sitemap.
Anyway, the sitemap protocol doesn't give an example, but it reports what the protocol for the sitemap is.
Comment #13
Anonymous (not verified) commentedAnd from the sitemap protocol you reference (sic):
Comment #14
avpadernoI don't know where you look at, but the first sitemaps sample I see are the following:
Out of 5 reported examples (including yours), 4 examples use only the XML namespace attribute.
Comment #15
avpadernoIf then we look at what the 6.2 branch does, it uses the simplified tag definition. I take it as Dave agrees with me on using the simplified version of the opening tag.
Comment #16
avpadernoThere is also an evident reason to not add the extra attributes in the opening tag.
Comment #17
Anonymous (not verified) commentedComment #18
avpadernoThe reason to not add the additional attributes is that the search engines do not need to validate the XML content because they know the sitemap format.