我调用以下命令并获得以下错误:
>>>lxml.etree.tostring([tree].getroot(), with_comments=False)
ValueError: Can only discard comments in C14N serialisation
我不知道C14N是什么,但我很感激解释我如何实现它并运行上述命令with_comments=False.(是的,我知道我可以使用正则表达式删除注释.请不要提供正则表达式作为解决方案.)
背景:我想通过http连接传输我的xml文档.我正在使用lxml Python库.我正在运行Python 2.7.1