views:

69

answers:

2

Hello All,

What this feature "http://apache.org/xml/features/dom/defer-node-expansion" does?

i have read about this feature. But was really unable to understand what will happen if this is set to false.

Can anyone come up elaborately on this as i don't find any other link that explain to the ability i understand.

+1  A: 

it is a form lazy loading: DOM nodes are created as you traverse tree.

This is a common design pattern, it is widely used. For example Hibernate calls it Lazy Fetching.

dfa
+2  A: 

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 ...

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

vtd-xml-author