What is DOM parser
Let’s understand what is DOM parser , DOM stands for Document Object Model that is use to parse and manipulate the XML file.
DOM API has been given by W3C organization which is adopted by java to read, write and update the XML file using java programming language.
DOM is an implementation of JAX-P API which is given by java people.
Advantage of DOM
- DOM allows us to parse XML data in random order.
- DOM is Read and Write parser.
- DOM is platform and language neutral.
- DOM is Tree based Parser.
- DOM allows developer to hierarchical navigate through the tree.
When to use DOM
When you want to get the data from XML file and you want to use that data in business processing. DOM will be used widely in REST and Web Services Application to read Client Requested data.
How does DOM works
DOM is a hierarchical processing model where DOM loads the entire XML file into one memory and will form the Tree to navigate from one node to another node.
DOM parser uses more memory because it dumps whole XML data into JVM memory and will form Tree.