Sample code for 30+ languages & platforms
Java

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Xml;

public class ChilkatExample {

    public static void main(String[] args) {
        Xml xml = new Xml();

        // Pass either an absolute file path, or a file path relative from the current working directory of the caller.
        try {
            xml.loadXmlFile("qa_data/hamlet.xml");
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
            return;
        }

        System.out.println("Success.");
    }
}