我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用bs4.dammit.EntitySubstitution.substitute_xml()。
def format_string(self, s, formatter='minimal'): """Format the given string using the given formatter.""" if not callable(formatter): formatter = self.FORMATTERS.get( formatter, EntitySubstitution.substitute_xml) if formatter is None: output = s else: output = formatter(s) return output
def substitute_xml(cls, ns): return cls._substitute_if_appropriate( ns, EntitySubstitution.substitute_xml)
def _formatter_for_name(self, name): "Look up a formatter function based on its name and the tree." if self._is_xml: return self.XML_FORMATTERS.get( name, EntitySubstitution.substitute_xml) else: return self.HTML_FORMATTERS.get( name, HTMLAwareEntitySubstitution.substitute_xml)