Code:
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
Output:
<?xml version='1.0' encoding='utf-8' ?>
<Collection>
<Items>href1.com</Items>
<Items>href2.com</Items>
</collection>
I would like to have a line like <Collection xmlns:p="somelines"> instead of <Collection>, but the : does not let me compile it. How can I “escape” it?
I don’t know if markup.py has something built-in to handle this, but it’s easy to force python to accept it using the
**syntax:output: