minidom.py 文件源码

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

项目:pmatic 作者: LarsMichelsen 项目源码 文件源码
def _set_prefix(self, prefix):
        nsuri = self.namespaceURI
        if prefix == "xmlns":
            if nsuri and nsuri != XMLNS_NAMESPACE:
                raise xml.dom.NamespaceErr(
                    "illegal use of 'xmlns' prefix for the wrong namespace")
        d = self.__dict__
        d['prefix'] = prefix
        if prefix is None:
            newName = self.localName
        else:
            newName = "%s:%s" % (prefix, self.localName)
        if self.ownerElement:
            _clear_id_cache(self.ownerElement)
        d['nodeName'] = d['name'] = newName
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号