这种在解析期间修改文档结构的做法可以使 DOM 树占用更少的内存,而且还可以减少在内存中遍历和修改文档时所花的时间。
Such modifications of the document structure during parsing can result in a smaller memory footprint for the DOM tree, and also reduce the time spent traversing a document and modifying it in memory.
新的过滤器 API 使您可以在解析期间通过请求解析器接受、忽略一个节点及其子节点或者将它们从产生的树中删除,来检查和修改文档的结构。
The new filter API lets you examine and modify a document’s structure during parsing by asking a parser to accept, skip, or remove a node and its children from the resulting tree.
对输入文档的结构进行任何修改,都需要对表达式进行大量调整。
Any changes to the structure of the input document create more places in which you have to adjust the expression.
应用推荐