I am trying to remove lnNumType tag from sectPr to remove line numbering, Here is the snippet,
actual=bodyBod.xml
import lxml.etree
doc = lxml.etree.fromstring(actual)
for child in doc.iter():
if "lnNumType" in child.tag:
child.remove
print "this is working",child.getparent().remove(child)
from lxml.etree import tostring
print 'final ======= ',tostring(doc)
Have successfully removed the tag
<w:lnNumType w:countBy="1" w:restart="continuous"/> but I am not able to reassign to "bodyBod.xml" , this is how I get this variable
I am trying to remove lnNumType tag from sectPr to remove line numbering, Here is the snippet,
Have successfully removed the tag
<w:lnNumType w:countBy="1" w:restart="continuous"/>
but I am not able to reassign to "bodyBod.xml" , this is how I get this variableThis is the error when assigning
Help me. Any other approach to remove line number.