Java
Chilkat2 Java
Load XML from Local FilePath
Demonstrates how to load XML from a local XML file.Chilkat Java Downloads
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.");
}
}