Since JDOM represent an API building on standard parsing packages, we can select the way we want the document be loaded from a file.

In order to load a JDOM document via SAX we hav to you SAXBuilder class. One of its constructors receives a boolean value, which allows to defined if the document must be validates or not. Sample below shows how it is easilly to load a JDOM document:

 import org.jdom.Document;
import org.jdom.input.SAXBuilder;

 * This sample program showing how to load JDOM document.
 * using SAX builder.

public class Test {
    public static void main(String[] args) {
        try {
            // a builder takes a boolean value meaning validation mode:
            SAXBuilder builder = new SAXBuilder(false);
            // simply load the document::
            Document document ="sample.xml");
            // .. do something ...
        } catch (Exception ex) {