74 Chapter 3 • Processing XML Documents with DOM
If the XML is in the form of a file (say myfile.xml), the file can be directly passed to the the JAXP parser’s parse() method in the following form:
String urlName = "http://localhost:8080/examples/Temp.xml";
URL url = new URL(urlName);
The parse() method now uses XMLStream to parse the XML.
Figure 3.10 An XML file with an External Entity
When the first XML file is run, the entity ext1 is resolved and the output is as shown in Figure 3.12.