Python generate XML with Schema-Locaion -
has idea how can create such xml:
<urlset xsi:schemalocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>http://...</loc> </url> </urlset> how can add xsi:schemalocation xml.etree? here's code:
urlset = et.element("urlset") url in self.urls: url = et.subelement(urlset, "url") et.subelement(url, "loc").text = url.loc self.tree = et.elementtree(urlset) self.tree.write(path) is there simple way add such attribute? thank you!!
Comments
Post a Comment