代码:
import markup
url_= ('href1.com','href2.com')
mycxml=markup.page(mode='xml', case='given')
mycxml.init(encoding='utf-8')
mycxml.Collection.open()
mycxml.Items(url_)
mycxml.collection.close()
print mycxml
输出:
<?xml version='1.0' encoding='utf-8' ?>
<Collection>
<Items>href1.com</Items>
<Items>href2.com</Items>
</collection>
我想要一行像<Collection xmlns:p="somelines">
而不是<Collection>
,但:
不允许我编译它。我怎样才能“逃脱”它?