Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is called defer-node-expansion in XML?

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.

like image 605
Gopi Avatar asked Oct 11 '25 08:10

Gopi


2 Answers

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

like image 195
vtd-xml-author Avatar answered Oct 17 '25 11:10

vtd-xml-author


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.

like image 44
dfa Avatar answered Oct 17 '25 11:10

dfa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!