On Jan 15, 5:22 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Peter Bengtsson wrote:
> > root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
> > root.set('xmlns:se', NS_URL)
> > entry = SubElement(root, 'entry')
> > SubElement(root, 'title').text = 'Title'
> > SubElement(entry, SEN('catego
Hallöchen!
Fredrik Lundh writes:
> Peter Bengtsson wrote:
>
>> root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
>> root.set('xmlns:se', NS_URL)
>> entry = SubElement(root, 'entry')
>> SubElement(root, 'title').text = 'Title'
>> SubElement(entry, SEN('category')).text = 'Category'
>
>>
Peter Bengtsson wrote:
> root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
> root.set('xmlns:se', NS_URL)
> entry = SubElement(root, 'entry')
> SubElement(root, 'title').text = 'Title'
> SubElement(entry, SEN('category')).text = 'Category'
> But surely the xmlns:se attribute on the tag
Here's my code (simplified):
NS_URL = 'http://www.snapexpense.com/atom_ns#'
ElementTree._namespace_map[NS_URL] = 'se'
def SEN(tag):
return "{%s}%s" % (NS_URL, tag)
root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
root.set('xmlns:se', NS_URL)
entry = SubElement(root, 'entry')
SubEle