java-xml
A Guide to XML in Java
1. Overview
We’ll go over the most common Java XML processing libraries – for both parsing and binding.
2. DOM Parsers
3. SAX Parser
4. StAX Parser
5. JAXB
JAXB is a part of the Java SE platform and one of the APIs in Java EE.
Useful Resources
* Oracle JAXB Tutorial
* JAXB Hello World Example
* JAXB Tutorial for Java XML Binding – The ULTIMATE Guide
* JAXB Tutorial
* JAXB Marshal Example
* JAXB Unmarshal Example
* How to convert Java Object to XML – JAXB Example
* JAXB example: Marshalling and Unmarshalling HashMap in java
* JAXB exmaple: Marshalling and Unmarshalling list or set of objects
* JAXB Annotations
* JAXB and Namespace Prefixes
* JAXB and Inheritance – Using XmlAdapter
6. XStream
Here’s the maven dependency to use to get it into a Maven enabled project:
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.8</version>
</dependency>
7. Jackson XML
In order to use it – here’s the simple Maven dependency you’ll need:
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
</dependency>
Note: Latest version of jackson-dataformat-xml right now is 2.6.3.
Useful Resources
8. Simple XML
In order to use it you need the following dependency:
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>${simple-xml.version}</version>
</dependency>
Note: Latest version of Simple XML right now is 2.7.1.