Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Reading from XML file in browser

Hi,

I've written an applet that reads from and write's to an XML file.
This works fine in the appletviewer but when i open the applet in the browser i get a nullpointerexception because the xml-file is not loaded and parsed.

Reading the xml file:
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse("data.xml");

Is there a way to acces the xml-file from the browser?
[445 byte] By [John852] at [2007-11-11 6:59:27]
# 1 Re: Reading from XML file in browser
yes, either give the complete URI in the builder.parse() or make sure the xml file is availlable on the classpath you set in the <object> tag where you load the applet
ractoc at 2007-11-11 22:39:44 >