本文整理汇总了Python中nlmmanipulate.NlmManipulate.remove_empty_elements方法的典型用法代码示例。如果您正苦于以下问题:Python NlmManipulate.remove_empty_elements方法的具体用法?Python NlmManipulate.remove_empty_elements怎么用?Python NlmManipulate.remove_empty_elements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmmanipulate.NlmManipulate
的用法示例。
在下文中一共展示了NlmManipulate.remove_empty_elements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_quirks
# 需要导入模块: from nlmmanipulate import NlmManipulate [as 别名]
# 或者: from nlmmanipulate.NlmManipulate import remove_empty_elements [as 别名]
def run_quirks(self, process_ref_lists):
manipulate = NlmManipulate(self.gv)
if self.gv.settings.get_setting('linebreaks-as-comments', self) == 'False':
# we need to convert every instance of <!--meTypeset:br--> to a new paragraph
manipulate.close_and_open_tag('comment()[. = "meTypeset:br"]', 'p')
manipulate.close_and_open_tag_not_styled('comment()[. = "meTypeset:br"]', 'title')
# we will replace inside table cells and titles regardless because these are real JATS break tags
manipulate.insert_break('comment()[. = "meTypeset:br"]', 'td')
manipulate.insert_break('comment()[. = "meTypeset:br"]', 'title')
manipulate.remove_empty_elements('//sec//p')
if process_ref_lists:
self.debug.print_debug(self, u'Finding potential reference lists')
manipulate.find_reference_list()
manipulate.tag_bibliography_refs()
manipulate.remove_empty_elements('//sec/list')
manipulate.remove_empty_elements('//sec/disp-quote')
manipulate.remove_empty_elements('//back/ref-list/ref')