ernado-x/X.Web.Sitemap

ArrayOfUrl instead of urlset?

pboisso opened this issue · 4 comments

Hi,

For some reason, when generating sitemaps, the list of url is getting out as

<ArrayOfUrl xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <url> ...

instead of
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> ...

Any idea why?

Got the nuget 2.0.5 version.

Thanks.

@ernado-x Has or is this issue being addressed?

There is a bug in ISitemapGenerator (SitemapGenerator.cs)

It uses incorrect serializer

_serializedXmlSaver = new SerializedXmlSaver<List<Url>>(new FileSystemWrapper());

instead of

_serializedXmlSaver = new SerializedXmlSaver<Sitemap>(new FileSystemWrapper());

And as i can see it works so only if you use generator with sitemap index. In case of a simple sitemap it's ok

I updated my fork with the change , but it still generating ArrayOfUrl in the xml. Even running the unit test generates files with ArrayOfUrl .