Coverage for lino/utils/xmlgen/etree.py : 59%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Based on Amaury's adaption of Eli Golovinsky's post http://stackoverflow.com/questions/174890/how-to-output-cdata-using-elementtree
Gooli's original snippet didn't work in Python 2.7
Added by LS: - support for _serialize_xml having different number of args depending on Python version - register_namespace is not in __all__
"""
element = etree.Element('![CDATA[') element.text = text return element
write("\n<%s%s]]>\n" % ( elem.tag, elem.text)) return
else: def register_namespace(*args, **kw): pass
|