本文整理汇总了Python中xml.dom.expatbuilder.parseString方法的典型用法代码示例。如果您正苦于以下问题:Python expatbuilder.parseString方法的具体用法?Python expatbuilder.parseString怎么用?Python expatbuilder.parseString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml.dom.expatbuilder
的用法示例。
在下文中一共展示了expatbuilder.parseString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseString
# 需要导入模块: from xml.dom import expatbuilder [as 别名]
# 或者: from xml.dom.expatbuilder import parseString [as 别名]
def parseString(string, parser=None):
"""Parse a file into a DOM from a string."""
if parser is None:
from xml.dom import expatbuilder
return expatbuilder.parseString(string)
else:
from xml.dom import pulldom
return _do_pulldom_parse(pulldom.parseString, (string,),
{'parser': parser})
示例2: parseString
# 需要导入模块: from xml.dom import expatbuilder [as 别名]
# 或者: from xml.dom.expatbuilder import parseString [as 别名]
def parseString(string, parser=None):
"""Parse a file into a DOM from a string."""
import sys
if parser is None and sys.platform[:4] != "java":
from xml.dom import expatbuilder
return expatbuilder.parseString(string)
from xml.dom import pulldom
return _do_pulldom_parse(pulldom.parseString, (string,),
{'parser': parser})
示例3: parseString
# 需要导入模块: from xml.dom import expatbuilder [as 别名]
# 或者: from xml.dom.expatbuilder import parseString [as 别名]
def parseString(string, parser=None):
"""Parse a file into a DOM from a string."""
if parser is None and sys.platform[:4] != "java":
from xml.dom import expatbuilder
return expatbuilder.parseString(string)
else:
from xml.dom import pulldom
return _do_pulldom_parse(pulldom.parseString, (string,),
{'parser': parser})