def _writeXML(xmlnode):
if isinstance(xmlnode, xml.dom.minidom.DocumentFragment):
d = xml.dom.minidom.Document()
d.childNodes += xmlnode.childNodes
xmlnode = d
s = xmlnode.toxml('utf-8')
# for clean round-tripping, remove headers -- I have great and
# specific worries that this will blow up later, but this margin
# is too narrow to contain them
if s.startswith(b('<?xml version="1.0" encoding="utf-8"?>')):
s = s[38:]
if s.startswith(b('<rdflibtoplevelelement>')):
s = s[23:-24]
if s == b('<rdflibtoplevelelement/>'):
s = b('')
return s
# Cannot import Namespace/XSD because of circular dependencies
评论列表
文章目录