p br using ElementTree?

2007-06-26 Thread Jan Danielsson
Hello all, This is probably a mind numbingly brain dead question.. But how do I generate the following: pCurrent date:br/2000-01-01/p ..using ElementTree? The p element kind of needs two text blocks, as far as I can tell? -- Kind regards, Jan Danielsson --

Re: p br using ElementTree?

2007-06-26 Thread Robert Kern
Jan Danielsson wrote: Hello all, This is probably a mind numbingly brain dead question.. But how do I generate the following: pCurrent date:br/2000-01-01/p ..using ElementTree? The p element kind of needs two text blocks, as far as I can tell? Use the .tail attribute on the br

Re: p br using ElementTree?

2007-06-26 Thread Jan Danielsson
Robert Kern wrote: [---] pCurrent date:br/2000-01-01/p [---] Use the .tail attribute on the br element: In [1]: from xml.etree import ElementTree as ET In [4]: p = ET.Element('p') In [5]: p.text = 'Current date:' In [6]: br = ET.SubElement(p, 'br') In [7]: br.tail = '2000-01-01'

Re: p br using ElementTree?

2007-06-26 Thread Gabriel Genellina
En Wed, 27 Jun 2007 01:12:10 -0300, Jan Danielsson [EMAIL PROTECTED] escribió: This is probably a mind numbingly brain dead question.. But how do I generate the following: pCurrent date:br/2000-01-01/p ..using ElementTree? The p element kind of needs two text blocks, as far as I