dcsimg

I want to parse an XML file stored on a remote server. Can I use the DOM for the same without downloading the file?

Surendra Chauhan

You can use the DOM to parse the XML file without downloading the file from the remote server. But you have to use the URL to access the file. Here is sample code.

        
    DOMParser parser = new DOMParser();
    URL url = createURL(remotefile);
    parser.parse(url);
    // Obtain the document.
    XMLDocument doc = parser.getDocument();