Category: XML

xml tutorials

Validate XML against XSD Schema using Java

In this example we will Validate XML against XSD Schema. We use the javax.xml.validation.Validator to check the XML document against the XSD schema. Be careful because the validator is not thread safe. It is the...
xml tutorials

Convert XML to Polymorphic Object using JAX-B

Here is an example of how you can convert XML to polymorphic objects using JAX-B. Abstract Animal Class package com.memorynotfound.xml.jaxb; public abstract class Animal { } Cat Inherits from Animal package com.memorynotfound.xml.jaxb; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name...
xml tutorials

Convert Polymorphic Object to XML using JAX-B

When you use polymorphism in your classes and you want to convert your object to XML using JAX-B, here is an example how to. Abstract Animal Class package com.memorynotfound.xml.jaxb; public abstract class Animal { }...
xml tutorials

Convert XML to Object in Java using JAX-B

In the following tutorial we will show you how you can convert XML to Object in Java using JAX-B. Annotations Explained First we need to define our model that will be converted to XML representation....
xml tutorials

Convert a Java Object to XML using JAXB

In the following tutorial we will show you how you can convert a Java Object to XML. Annotations Explained First we need to define our model that will be converted to XML representation. Here are...