How to create the same XML element 3 times with Python LXML Objectify

Depemique

New Member
I asked a question about adding multiple elements a couple weeks ago and now I've run into a similar issue. I have to create some XML where I'll have the following:\[code\]<embossed> <line>Test Line</line> <line>Test Line 2</line> <line>Test Line 3</line></embossed>\[/code\]I cannot figure out how to create the same element N times in a row with different text using the LXML objectify.Element() method. I tried this:\[code\]embossed = objectify.Element('embossed')embossed.line = objectify.Element("line")embossed.line = objectify.Element("line")\[/code\]But I end up with only one "line" element inside the "embossed" element. Does anyone know how to do this? Thanks!
 
Back
Top