in XML:TWIG, how to stop parsing once find the interested element

╄→尐↘猪︶ㄣ 提交于 2019-12-01 19:14:24

It seems what you're looking for are XML::Twig's finish_print and finish_now :

finish_print

Stops twig processing, flush the twig and proceed to finish printing the document as fast as possible. Use this method when modifying a document and the modification is done.

finish_now

Stops twig processing, does not finish parsing the document (which could actually be not well-formed after the point where finish_now is called). Execution resumes after the Lparse> or parsefile call. The content of the twig is what has been parsed so far (all open elements at the time finish_now is called are considered closed).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!