RE: error in bulding a document from an xml file usingSAX builder
"Michael Kay" <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <FA1037F085B449C384C8001F6054BD9B@Sealion> |
The StringReader supplied to build() should contain the contents of the XML document, not the name of the file containing the XML document. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of jdomuser > Sent: 30 August 2008 10:25 > To: [email protected] > Subject: [jdom-interest] error in bulding a document from an > xml file usingSAX builder > > > 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-tp19226715p19226715.html > 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@you > rhost.com _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]