Java XML – JDOM2 – SAXBuilder Example

In this tutorial we look at how to build a JDOM2 using a SAXBuilder. To understand how SAXBuilder works and how to configure it look at this tutorial. The example below demonstrates the following Building a JDOM2 document using a SAXBuilder. Obtaining the DOCTYPE of the document. Obtaining the root element of the document Obtaining … Read more

Java XML – Example JDOM2 Usage

Building JDOM2 Document In this tutorial we look at an example of how to build and navigate through a JDOM2 document from an XML source (in this case, a BBC News “Technology” RSS feed). We first use the org.jdom2.input.SAXBuilder class to create the JDOM2 document from the source (more details and options on the SAXBuilder … Read more

Java XML – JDOM2 – Packages

In this tutorial we explore the package structure and important classes for Jdom2. org.jdom2 This package contains the core classes that represent the XML components. Document – Represents the complete XML document. It provides access to the root element and also the docType. DocType – Represents an XML DOCTYPE. Element – Represents an XML element. … Read more

Java XML – JDOM2 – Introduction

What is JDOM JDOM is an in-memory XML model that can be used to read, write, create and modify XML Documents. JDOM is similar to DOM in that they both provide an in-memory XML document model, but while DOM is designed to work the same in multiple languages (C, C++, ECMAScript, Java, JScript, Lingo, PHP, … Read more