term.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:prophet 作者: MKLab-ITI 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号