uhaciogullari / SimpleMvcSitemap

A minimalist library for creating sitemap files inside ASP.NET MVC and ASP.NET Core MVC applications
MIT License
128 stars 39 forks source link

Translations make the sitemap not work #22

Closed romias closed 7 years ago

romias commented 7 years ago

Once I enter the translation collection to a SitemapNode, the generated sitemap is no longer a XML, it is just a string with concatenated urls

uhaciogullari commented 7 years ago

Hi @romias

I think I get what you mean. We have to add "xmlns:xhtml" namespace when there is a translation node. Then the browser thinks it's HTML and it only displays the texts within the tags.

If you view the source in the browser, you will see that the correct sitemap file is generated. translation

keyone2693 commented 4 years ago

same here

Racines commented 3 years ago

The problem is still present. @uhaciogullari If I understand you correctly, the bug is only visual and google bot will be able to use the sitemap as expected? Is there a way to add the" xmlns:xhtml" namespace myself somehow ?

EDIT: it seems there is arleady the "@xmlns:xhtml:http://www.w3.org/1999/xhtml" namespace added but not resolve the probleme.

uhaciogullari commented 3 years ago

The namespace is already added. View the source on your sitemap endpoint and you will see that correct XML is generated.

Racines commented 3 years ago

yes I used some sitemap validator, it seems to be ok, thanks