[jdom-interest] java.net.MalformedURLException

Elliotte Rusty Harold elharo at metalab.unc.edu
Tue Oct 7 17:53:06 PDT 2003

At 1:18 PM -0700 10/7/03, Fedor Smirnoff wrote:


          SAXBuilder builder = new SAXBuilder(false);
          Document doc = builder.build(bf.toString());

Where bf is a StringBuffer populated by readLine() from:

BufferedReader in = new BufferedReader(new 

I get Java err: java.net.MalformedURLException: no protocol:

Read the JavaDoc. That constructor expects to receive a String 
containing the URL of the document, not a String containing the 
document itself. Pass the reader to the parse method without 
converting it to a string first.

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)

More information about the jdom-interest mailing list