Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can we use Iterator to traverse JDOM/DOM tree?

DOM iterator jdom Traverse tree
0
Posted

Can we use Iterator to traverse JDOM/DOM tree?

0

No, DOM tree or JDOM Document trees are not collection classes; they are way more complicated. You cannot simply use Iterator to traverse them. More interesting thing is JDOM tree is not all built into memory, it is built on demand (lazy initialization design pattern). That is why JDOM is much faster than DOM. However, if you want to traversal the entire JDOM tree, then the advantage of JDOM over DOM disappears. Here, what we are talking about really has nothing to do with advantages or shortcomings. We are talking about using the right tool to solve the right problems. If you use a baseball bat to sew your clothes, even it has a hole at the bigger end. You know what I mean… Different tools are for different purposes. See here.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123