Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 19753 invoked from network); 21 Nov 2007 15:46:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2007 15:46:56 -0000 Received: (qmail 58168 invoked by uid 500); 21 Nov 2007 15:46:43 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 58149 invoked by uid 500); 21 Nov 2007 15:46:43 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 58076 invoked by uid 99); 21 Nov 2007 15:46:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Nov 2007 07:46:43 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.163.178.162] (HELO web34413.mail.mud.yahoo.com) (66.163.178.162) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 21 Nov 2007 15:46:43 +0000 Received: (qmail 24701 invoked by uid 60001); 21 Nov 2007 15:46:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=4FMQlBphX0F7qbb82ZGcVSzD+1DrznwuDLwANeE75Bh04ZXEas/hI9At1C+k0dzECDBS/hFJ+H/FhbVzIViVzPkUqOdHtUk62BmXb2gvTgC9GGx0mM2hedvlEckZ0pskAOm0QpFGzQZmyJuxi4qeGThm5Ef+pcHpIsEd7zHzHC8=; X-YMail-OSG: A72lpHQVM1mqdJhHBvmxiCgVSnhUk.5B8Ll9GsRbHqBQVYtrwioe9wk24PDAw_u30w-- Received: from [82.122.221.134] by web34413.mail.mud.yahoo.com via HTTP; Wed, 21 Nov 2007 07:46:21 PST X-Mailer: YahooMailRC/818.27 YahooMailWebService/0.7.157 Date: Wed, 21 Nov 2007 07:46:21 -0800 (PST) From: Laurent ROCHE Subject: Reading model file with Java API [aka Re : Re : Still one problem when managing schema ... others fixed !] To: ddlutils-user@db.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-545368007-1195659981=:23728" Message-ID: <777704.23728.qm@web34413.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-545368007-1195659981=:23728 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AOK, at last I have found the problem, I needed to set two flags (s= etValidateXml, setUseInternalDtd) on the reader (i.e. DatabaseIO object).= =0ASo the code from previous post (see further) becomes :=0A Platfor= m platform =3D PlatformFactory.createNewPlatformInstance(dataSource);=0A = final DatabaseDataIO dataIO =3D new DatabaseDataIO();=0A dataI= O.setDetermineSchema(true);=0A dataIO.setSchemaPattern(XFR_OUT_SCHEM= A);=0A try {=0A FileOutputStream xmlFile =3D new FileOutp= utStream(xmlFPN);=0A++ DatabaseIO reader =3D new DatabaseIO(); =0A= ++ reader.setValidateXml(false);=0A++ reader.setUseIntern= alDtd(true);=0A+- Database model =3D reader.read(getModelFPN(), XF= R_OUT_SCHEMA);=0A dataIO.writeDataToXML(platform, model, xmlFile= , XML_FILE_ENCODING);=0A xmlFile.close();=0A } catch (IOE= xception e) {=0A e.printStackTrace();=0A log.error("E= rror: Could not create " + xmlFPN);=0A }=0A=0A=0A =0AHave fun,=0AL@u= =0AThe Computing Froggy=0A=0A----- Message d'origine ----=0ADe : Laurent RO= CHE =0A=C3=80 : ddlutils-user@db.apache.org=0AEnvo= y=C3=A9 le : Mardi, 20 Novembre 2007, 12h24mn 57s=0AObjet : Re : Still one = problem when managing schema ... others fixed !=0A=0AHi,=0A=0AI am still ha= ving the problem described below.=0A=0AHas anyone succeeded in reading a mo= del from a XML file using the Java=0A API (DatabaseIO.read() ) without any = errors ?=0AIf so could he/she publish the piece of code reading the model a= nd the=0A XML file of the model, so I can see what I am doing wrong !=0A=0A= =0AThanks in advance,=0AL@u=0AThe Computing Froggy=0A=0A----- Message d'or= igine ----=0ADe : Laurent ROCHE =0A=C3=80 : ddluti= ls-user@db.apache.org=0AEnvoy=C3=A9 le : Mercredi, 14 Novembre 2007, 16h25m= n 45s=0AObjet : Still one problem when managing schema ... others fixed != =0A=0AHi,=0A=0AI have made a few fixes to be able to export/import data usi= ng schemas=0A (on PostgreSQL), see files included at the end of the post.= =0AMost of them are quite ugly fixes but that works for me ... and still,= =0A they should not interfere with other people usage.=0A=0AI still have on= e problem though, when running the following code:=0A ...=0A Pl= atform platform =3D=0A PlatformFactory.createNewPlatformInstance(dataSourc= e);=0A final DatabaseDataIO dataIO =3D new DatabaseDataIO();=0A = dataIO.setDetermineSchema(true);=0A dataIO.setSchemaPattern(XFR_O= UT_SCHEMA);=0A try {=0A FileOutputStream xmlFile =3D new = FileOutputStream(xmlFPN);=0A DatabaseIO reader =3D new DatabaseI= O();=0A Database model =3D reader.read(getModelFPN(),=0A XFR_OUT= _SCHEMA);=0A dataIO.writeDataToXML(platform, model, xmlFile,=0A = XML_FILE_ENCODING);=0A xmlFile.close();=0A } catch (IOExc= eption e) {=0A e.printStackTrace();=0A log.error("Err= or: Could not create " + xmlFPN);=0A }=0A ...=0A=0AI get the fol= lowing errors:=0A[fims] ERROR [http-80-Processor24]=0A Digester.error(1538)= | Parse Error at line 2 column 32: Document root=0A element "database", mu= st match DOCTYPE root "null".=0Aorg.xml.sax.SAXParseException: Document roo= t element "database", must=0A match DOCTYPE root "null".=0A at=0A com.su= n.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseExcepti= on(ErrorHandlerWrapper.java:236)=0A at=0A com.sun.org.apache.xerces.inte= rnal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)=0A...=0A[= fims] ERROR [http-80-Processor24] Digester.error(1538) | Parse Error=0A at = line 2 column 32: Document is invalid: no grammar found.=0Aorg.xml.sax.SAXP= arseException: Document is invalid: no grammar found.=0A at=0A com.sun.o= rg.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(= ErrorHandlerWrapper.java:236)=0A...=0AThe file is created OK though ! ? ! ?= =0AWhat=0A should I do, to get rid of this error messages ?=0AI understand = they come from the parser going through the XML ... but=0A why don't I get = these when using the Ant tasks ?=0AI must do something wrong somewhere !=0A= Let me know.=0A=0A...=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A =0A _______________= ______________________________________________________________ =0ANe gardez= plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!=0A Mail =0A= =0A=0A=0A=0A=0A ______________________________________________________= _______________________ =0ANe gardez plus qu'une seule adresse mail ! Copie= z vos mails vers Yahoo! Mail --0-545368007-1195659981=:23728--