0

I'm trying to parse the XML from https://isc.sans.edu/api/infocon, specifically the status node, but I can't even seem to load the XML doc:

 URL url = new URL("https://isc.sans.edu/api/infocon");
 URLConnection connection = url.openConnection();

 InputStream responseStream = connection.getInputStream();

 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
 DocumentBuilder db = dbf.newDocumentBuilder();

 Document doc = db.parse(responseStream);

 System.out.println(doc.toString());

doc is always null, any ideas why?

timbo baggins
  • 45
  • 1
  • 1
  • 3

1 Answers1

0

Your problem seems like to be similar to https://stackoverflow.com/a/2019407/1450348. I ran your application and I can see that the parsing has been done successfully.

enter image description here

Community
  • 1
  • 1
manman
  • 4,743
  • 3
  • 30
  • 42