I want to use JDOM, so I want to Know the equivalent to this code written by DOM:
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
URL Url = new URL(url);
Document doc = builder.parse(Url.openStream());
I use this example:
//On crée une instance de SAXBuilder
SAXBuilder sxb = new SAXBuilder();
try
{
//On crée un nouveau document JDOM avec en argument le fichier XML
//Le parsing est terminé ;)
document = sxb.build(new File("Exercice2.xml"));
}
catch(Exception e){}
but I want to use an URL instead of an XML file.