Thursday, February 09, 2006
Load XML File With JAXP
The following is a short example of loading a file using JAXP.
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.w3c.dom.*;
public class Example {
static Document document;
public static void main (String[] ARGS) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
document = db.parse("./BAKLO211.xml");
}
catch (Exception e) {
e.printStackTrace(System.err);
}
}
}