Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Creating sub elements in xml in python with ElementTree

>>> a = ET.Element('a')
>>> b = ET.SubElement(a, 'b')
>>> c = ET.SubElement(a, 'c')
>>> d = ET.SubElement(c, 'd')
>>> ET.dump(a)
<a><b /><c><d /></c></a>
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Creating #elements #xml #python #ElementTree
ADD COMMENT
Topic
Name
9+1 =