I am new to go but not sitemaps. I am not very experienced writing go so there may be something I do not understand that I am doing causing the behavior.
Context:
Generating a sitemap with URLs and Images.
Problem:
XML that elements are out of order. The XML fails to validate with xmllint: ./mymappath/sitemap/sitemap1.xml:72: element caption: Schemas validity error : Element '{http://www.google.com/schemas/sitemap-image/1.1}caption': This element is not expected. Expected is ( {http://www.google.com/schemas/sitemap-image/1.1}loc ).
I would expect that the xml elements are in the same order for all urls, but instead sometimes they are out of order.
Different runs produce different numbers of the problem on different data. I first blamed my code and hard-coded the image data map, but I still got the same varying order. I wonder if it is the way etree is used or the way xml is used in etree.
I am new to go but not sitemaps. I am not very experienced writing go so there may be something I do not understand that I am doing causing the behavior.
Context:
Generating a sitemap with URLs and Images.
Problem:
XML that elements are out of order. The XML fails to validate with xmllint:
./mymappath/sitemap/sitemap1.xml:72: element caption: Schemas validity error : Element '{http://www.google.com/schemas/sitemap-image/1.1}caption': This element is not expected. Expected is ( {http://www.google.com/schemas/sitemap-image/1.1}loc ).
Here is the offending xml:
I would expect that the xml elements are in the same order for all urls, but instead sometimes they are out of order.
Different runs produce different numbers of the problem on different data. I first blamed my code and hard-coded the image data map, but I still got the same varying order. I wonder if it is the way
etree
is used or the wayxml
is used inetree
.