Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong xml format: white space error
    primarykey
    data
    text
    <p>I apologize for asking the same question, but as per my research it seemed in different context. I know why the error is coming but I failed to eradicate it without looking and following some programming forums. My program goes as follows: I am pinging a url and opening input stream, then that stream is written into an xml file. After that I am using Xpath to extract some information that is further used for some computation. My code is as follows:</p> <pre><code> URL u=new URL("url here"); HttpURLConnection con=(HttpURLConnection)u.openConnection(); InputStream is=con.getInputStream(); BufferedInputStream br=new BufferedInputStream(is); File f=new File("data.xml"); if(f.exists())f.delete(); f.createNewFile(); byte data[] = new byte[1024]; int count; FileOutputStream fout = new FileOutputStream(f); while((count = br.read(data,0,1024)) != -1) { fout.write(data, 0, count); } fout.close(); DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance(); DocumentBuilder db=dbf.newDocumentBuilder(); Document doc=db.parse("data.xml"); XPathFactory factory=XPathFactory.newInstance(); XPath xPath=factory.newXPath(); XPathExpression expr = xPath.compile("//tr/text()"); Object result = expr.evaluate(doc, XPathConstants.NODESET); NodeList nodes = (NodeList) result; for (int i = 0; i &lt; nodes.getLength(); i++) { System.out.println(nodes.item(i).getNodeValue()); } </code></pre> <p>when executing this code I get : <strong>White spaces are required between publicId and systemId</strong>. Since I am directly writing to the file, where can this white space error possibly occur?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload