简体   繁体   English

什么叫XML中的延迟节点扩展?

[英]What is called defer-node-expansion in XML?

What this feature " http://apache.org/xml/features/dom/defer-node-expansion " does? 这个功能“ http://apache.org/xml/features/dom/defer-node-expansion ”有什么作用?

i have read about this feature . 我已阅读有关此功能的信息 But was really unable to understand what will happen if this is set to false. 但实际上无法理解如果将其设置为false将会发生什么。

Can anyone come up elaborately on this as i don't find any other link that explain to the ability i understand. 任何人都可以精心制作这个,因为我没有找到任何其他链接解释我理解的能力。

by deferred node expansion, basically, a lot of objects/strings are not created/allocated until you navigate to the corresponding node position... it makes dom parsing a bit faster but tree traversal slower ... 通过延迟节点扩展,基本上,在导航到相应的节点位置之前,不会创建/分配大量对象/字符串...它使得dom解析速度更快但树遍历更慢...

the initial memory consumption is lower than a full-expanded DOM tree, but after traversal, the memory usage could easily be a lot higher than a full-expanded DOM tree... beware of the catch 初始内存消耗低于完全扩展的DOM树,但在遍历之后,内存使用量可能比完全扩展的DOM树要高很多...谨防捕获

it is a form lazy loading : DOM nodes are created as you traverse tree. 它是一种延迟加载形式:在遍历树时创建DOM节点。

This is a common design pattern, it is widely used. 这是一种常见的设计模式,因此被广泛使用。 For example Hibernate calls it Lazy Fetching . 例如,Hibernate将其称为Lazy Fetching

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM