Java Mailing List Archive

http://www.junlu.com/

Home » JDOM Projects »

[jdom-interest] error in bulding a document from an xml file using
 SAX builder

jdomuser

2008-08-30

Replies: Find Java Web Hosting

Author LoginPost Reply

hello i m using new jdom1.1. I wanted to build a document from an existing
xml file, by giving its string path to SAX builder's build method.

Document doc;
String xmlfile = "c:\\tmp\\foo.xml";
SAXBuilder builder = new SAXBuilder();
builder.setValidation(true);
builder.setIgnoringElementContentWhitespace(true);
  try{    
     doc = builder.build(new StringReader(xmlfile));      
  } catch (JDOMException e) {
      System.out.println("Error in building JDOM file");
  } catch (IOException e) {
      System.out.println("Error in building JDOM file");
  }

unfortunately, i got a JDOMException here. what do you think about the
reason?

regards.
--
Sent from the JDOM - General mailing list archive at Nabble.com.

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.