Python使用SchemaLocation生成XML

2024-05-29 02:48:26 发布

您现在位置:Python中文网/ 问答频道 /正文

如何创建这样的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>

如何添加xsi:schemaLocation与xml.etree?我的代码是:

^{pr2}$

有没有简单的方法来添加这样的属性?在


Tags: orghttpurlwwwxmlschemaslocetree

热门问题