In this section, we'll accomplish a very simple task to get ourselves started on the road to learning how Java interacts with XML. We'll use the XML information from the cars.xml file, provided in the code file of the book. This file should be stored in the current directory of our Java project, so when we run our Java program, it will be able to access cars.xml without any additional pathing required. We'll edit the following Java program to load the cars.xml file:
package loadinganxmlfile; import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*; import org.xml.sax.*; public class LoadingAnXMLFile { public static void main(String[] args) { try { //Write code that can throw errors here ...