本文整理匯總了Python中xml.dom.xmlbuilder.Options方法的典型用法代碼示例。如果您正苦於以下問題:Python xmlbuilder.Options方法的具體用法?Python xmlbuilder.Options怎麽用?Python xmlbuilder.Options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xml.dom.xmlbuilder
的用法示例。
在下文中一共展示了xmlbuilder.Options方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from xml.dom import xmlbuilder [as 別名]
# 或者: from xml.dom.xmlbuilder import Options [as 別名]
def __init__(self, options=None):
if options is None:
options = xmlbuilder.Options()
self._options = options
if self._options.filter is not None:
self._filter = FilterVisibilityController(self._options.filter)
else:
self._filter = None
# This *really* doesn't do anything in this case, so
# override it with something fast & minimal.
self._finish_start_element = id
self._parser = None
self.reset()
示例2: makeBuilder
# 需要導入模塊: from xml.dom import xmlbuilder [as 別名]
# 或者: from xml.dom.xmlbuilder import Options [as 別名]
def makeBuilder(options):
"""Create a builder based on an Options object."""
if options.namespaces:
return ExpatBuilderNS(options)
else:
return ExpatBuilder(options)