I'm currently writing a text processing program in Java that needs to pull XML from an XML file and convert that into a Java object. I'm using what the quick tutorial on the XStream website suggested:
XStream xstream = new XStream();
Map<String, Integer> englishCorpusProbDist = (Map<String, Integer>)xstream.fromXML(xmlString);
where "xmlString" is the XML code. The only problem is that I have the XML in an XML file saved elsewhere on my computer, rather than as a string in my program. Is there a way to feed in the local address of the XML file into the .fromXML function and have it read the XML in the file, rather than directly feeding the XML itself into the function?
Any help would be much appreciated. Thanks in advance!