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

jdomuser hakeem35 at live.com
Sat Aug 30 06:04:43 PDT 2008


i dont know why, but once i deleted the setValidation and
setIgnoringElementContentWhitespace lines, it just worked with no error..


jdomuser wrote:
> 
> 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.
> 

-- 
View this message in context: http://www.nabble.com/error-in-bulding-a-document-from-an-xml-file-using-SAX-builder-tp19226715p19233191.html
Sent from the JDOM - General mailing list archive at Nabble.com.



More information about the jdom-interest mailing list