Java XML DOM Parser Overview
Description:
- The Document Object Model (DOM) is an official recommendation of the World Wide Web Consortium (W3C).
- The DOM is the easiest to use Java XML Parser.
- It parses an entire XML document and load it into memory, modeling it with Object for easy nodel traversal.
- DOM Parser is slow and consume a lot memory if it load a XML document which contains a lot of data.
Figure1 |
When to use:
- You need to know a lot about the structure of a document.
- You need to move parts of an XML document around.
- You need to use the information in an XML document more than once.
Important class and interface:
- DocumentBuilderFactory(C)
- DocumentBuilder(C)
- Document(I)
- Element(I)
- NodeList(I)
- Node(I)
- NamedNodeMap(I)
- Tranformer(C)
- TransformerFactory(C)
- DOMSource(C)
- StreamResult(C)
C- Class, I - Interface
Questions :
- How to create XML file?
- How to read XML file?
- How to do search in XML file?
- How to add new node in XML file?
- How to delete node from XML file?
- How to add new child node to given node in XML file?
- How to delete child node from given node in XML file?
- How to add new attribute to given node in XML file?
- How to delete attribute from given node in XML file?
Don't forget to check top 40 problems with solution on Date and Time - Click Here
Thank you friends. If you have any doubt, suggestion or query please feel free to comment below.
Thank you friends. If you have any doubt, suggestion or query please feel free to comment below.
Java XML DOM Parser Overview
Reviewed by Rohit Agarwal
on
10/14/2017
Rating:
No comments:
Please provide your valuable comments. If you have any suggestion please share with me I will work on it and if you have any question or doubt please ask, don't hesitate. I am your friend, i will clarify all your doubts.