sitemap-generator icon indicating copy to clipboard operation
sitemap-generator copied to clipboard

xml from the example is not well formed

Open thanakijwanavit opened this issue 3 years ago • 0 comments

I ran the example code and generated the sitemap file, however when reading the file, I get this error ExpatError: not well-formed (invalid token): line 56, column 109

It seems that this is due to the semicolon on this line '<url><loc>https://www.haikson.com/my-projects/pynger/pynger-0-2/&quot;http:/ask.com&quot;&gt;ask.com&lt;/a&gt</loc></url>'

Here is the code I ran

import xml.etree.ElementTree as ET
xml_data = open('sitemap.xml', 'r').read()  # Read file
root = ET.XML(xml_data)

thanakijwanavit avatar May 02 '21 01:05 thanakijwanavit