Hi, I am still having the problem described below.
Has anyone succeeded in reading a model from a XML file using the Java API (DatabaseIO.read() ) without any errors ? If so could he/she publish the piece of code reading the model and the XML file of the model, so I can see what I am doing wrong ! Thanks in advance, [EMAIL PROTECTED] The Computing Froggy ----- Message d'origine ---- De : Laurent ROCHE <[EMAIL PROTECTED]> À : [email protected] Envoyé le : Mercredi, 14 Novembre 2007, 16h25mn 45s Objet : Still one problem when managing schema ... others fixed ! Hi, I have made a few fixes to be able to export/import data using schemas (on PostgreSQL), see files included at the end of the post. Most of them are quite ugly fixes but that works for me ... and still, they should not interfere with other people usage. I still have one problem though, when running the following code: ... Platform platform = PlatformFactory.createNewPlatformInstance(dataSource); final DatabaseDataIO dataIO = new DatabaseDataIO(); dataIO.setDetermineSchema(true); dataIO.setSchemaPattern(XFR_OUT_SCHEMA); try { FileOutputStream xmlFile = new FileOutputStream(xmlFPN); DatabaseIO reader = new DatabaseIO(); Database model = reader.read(getModelFPN(), XFR_OUT_SCHEMA); dataIO.writeDataToXML(platform, model, xmlFile, XML_FILE_ENCODING); xmlFile.close(); } catch (IOException e) { e.printStackTrace(); log.error("Error: Could not create " + xmlFPN); } ... I get the following errors: [fims] ERROR [http-80-Processor24] Digester.error(1538) | Parse Error at line 2 column 32: Document root element "database", must match DOCTYPE root "null". org.xml.sax.SAXParseException: Document root element "database", must match DOCTYPE root "null". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) ... [fims] ERROR [http-80-Processor24] Digester.error(1538) | Parse Error at line 2 column 32: Document is invalid: no grammar found. org.xml.sax.SAXParseException: Document is invalid: no grammar found. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) ... The file is created OK though ! ? ! ? What should I do, to get rid of this error messages ? I understand they come from the parser going through the XML ... but why don't I get these when using the Ant tasks ? I must do something wrong somewhere ! Let me know. ... _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
