dom4j is an open-source Java library for working with XML. If you have never used it, a video is a friendly way to see it in action before you dive into the details. Below is a short tutorial with time stamps, followed by links to our own written guides.
The video is a little bit of a mediocre quality; but the author makes a great and simple tutorial to get you started with Dom4J!
- 00:20 How to download and start using dom4j?
- 00:50 How to use dom4j in a java project?
- 01:40 How to use dom4j to generate xml?
- 03:00 How to add elements using dom4j?
- 04:10 How to use dom4j to create a document?
- 04:30 How to add text to an element in dom4j?
- 05:30 How to format xml when using dom4j?
Continue with our written guides
The video shows the basics. Our step-by-step guides go further, with code you can copy:
- dom4j: the Java XML library explained – what it is and how to add it to Maven or Gradle.
- Reading and parsing XML with dom4j.
- Using XPath with dom4j.
- Creating and writing XML with dom4j – including pretty-printing, as in the video.
- Secure XML parsing with dom4j – read this before you parse XML from other sources.
