I am trying to read an XML file with this header:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="MeasDataCollection.xsl"?>
<!DOCTYPE mdc SYSTEM "MeasDataCollection.dtd">
I create a pathName for this file in a method :
String filePathName = appProperties.getProperty("xmlFilesLocation") + "/" +
appProperties.getProperty("adaptorLA") + "/" + tempName; //tempName is the file's name, it is file.xml here
and I am trying to re-open and parse the file with such code in another method:
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = documentBuilder.parse(file);
This is where my program crashes, I get an error that the file "MeasDataCollection.dtd" does not exist. I do not excplicitly assign this file name to the path I am trying to parse, but it seems that somehow it messes with my file name.
I am struggling to understand what this "doctype ... system ..." means and how it affects my code.
All help is appreciated.