Home » Core Java » xml » bind


JAXB Schema Validation Example

In this example, we shall learn how to validate XML against schema using JAXB. Here, we are talking about validating XML against XSD. Validation in context here is the process of verifying that an XML document meets all the constraints expressed in the schema or XSD. JAXB provides functions for validation during unmarshalling but not during marshalling. Let’s understand this ...

Read More »

JAXB: Generate Classes from XSD

In this tutorial, we shall learn generating classes from XML Schema Design (XSD) using JAXB. This can be achieved using JAXB binding compiler XJC command. XJC is included in the bin directory in the JDK starting with Java SE 6. 1. Requirements To see this example in action, following is the minimum requirement: JDK 6 (Java SE 6) or later ...

Read More »

JAXB Binding Example

JAXB stands for Java Architecture for XML Binding. JAXB provides convenient way to bind XML schemas and Java representations, making it easy for developers to work with XML data and its processing in Java based applications. To help with this, JAXB provides methods for unmarshalling XML instance documents into Java content trees, and then marshalling Java content trees back into ...

Read More »


In this example we shall show you how to make use of JAXB-JSON. JAXB is a java architecture for XML binding is an efficient technology to convert XML to and from Java Object. EclipseLink JAXB (MOXy) is one of JAXB implementation which is mostly used to create java classes from XML or JSON. In Java JAXB provides two general purpose ...

Read More »

JAXB unmarshal example

In my last article, I’ve explained how to marshall java objects to xml using JAXB. In this one, we are going to see how to do the complementary operation: unmarshal xml files into java objects and what should be taken into consideration while doing this operation. For this purpose we are going to use the same example as in the ...

Read More »

JAXB marshal example

In this example we are going to show how to use the JAXB marshal functionalities. JAXB offers the possibility to convert Java objects into XML structures and vice versa, it comes with the JRE bundle since the first versions of the JRE 1.6. As example, we are going to create a list of museums and store it in a specific ...

Read More »

JAXB Hello World example

With this example we shall show you how to work with the JAXB framework in Java. JAXB stands for Java Architecture for XML Binding. You can use JAXB to convert an object to XML format and write it to an XML File as well as read an XML File and construct a Java object out of it. These to operations ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns