This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(billFile); Element root = doc.getRootElement();
I am trying to parse an xml file using JDOM. I am using above lines to create the document from billFile which is a File object. At this point, doc is in memory. Does it means it holds entire document in memory or it only holds some information, pulls it as and when required. please clarify
It's all in memory. In other words, holding a reference to a JDOM document built from an XML file of 3 megabytes will take at least 3 megabytes of memory ("at least" because the object structure takes more space than the raw data).