How the jaxp parser reads the xml depends upon the input stream example
74 Chapter 3 • Processing XML Documents with DOM
File-based Source
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.
www.syngress.com
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.
www.syngress.com |
---|