You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
johnelliott
changed the title
Elements for Image serialized out of order.
Elements for Image are serialized out of order.
Mar 3, 2019
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
.The text was updated successfully, but these errors were encountered: