Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 77571 invoked from network); 4 Aug 2000 12:36:24 -0000 Received: from sundn.pb.teuto.net (HELO viruswall.ynes.de) (212.8.194.130) by locus.apache.org with SMTP; 4 Aug 2000 12:36:24 -0000 Received: from 10.10.1.10 by viruswall.ynes.de (InterScan E-Mail VirusWall NT); Fri, 04 Aug 2000 14:35:55 +0200 (Westeuropaeische Sommerzeit) Received: from hw0230 (fw-dmz.ynes.de [10.10.1.1]) by mail.ynes.de (8.9.3/8.9.3/NoSpam) with SMTP id NAA24160 for ; Fri, 4 Aug 2000 13:35:50 +0200 From: "Carsten Ziegeler" To: Subject: C2: Problems with SQLTransformer and Xerces solved Date: Fri, 4 Aug 2000 14:39:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi, after some experimenting with the SQLTransformer I found out the = following: The problems are not based on the Transformer itself but on Xerces. = Using the following simple XML-File, Xerces generates wrong = endElement()-Events: select * from user In version 1.1.2 of Xerces the SQLTransformer receives an endElement() = event with=20 uri=3D"http://xml.apache.org/cocoon/SQL", name=3D"sql:execute-query" and = raw=3D"sql:execute-query". So the name attribute is wrong and you get a SAXException: Raw/Local = Name mismatch. In version 1.1.3 of Xerves this bug is fixed but there is still another = bug, as the SQLTransformer now receives an endElement() event with = uri=3D"http://xml.apache.org/cocoon/SQL", name=3D"body" and = raw=3D"body". In this case the uri is wrong. The SQLTransformer now gets his uri and = then assumes body is the value element. The following diff of the SQLTransformer performs an additional check. = If the incoming element is not one of those=20 the SQLTransformer recognizes (execute-query, query, ancestor-value, = value) the endElement() method passes this to super. So the end of the endElement() method should look like this: if (name.equals(MAGIC_EXECUTE_QUERY)) { endExecuteQueryElement(); } else if (name.equals(MAGIC_QUERY)) { endQueryElement(); } else if (name.equals(MAGIC_ANCESTOR_VALUE)) { endAncestorValueElement(); } else if (name.equals("value")) { // THIS CHECK IS NEW endValueElement(); } else { super.endElement(uri, name, raw); // SEND IT TO = SUPER } This patch only works if you update from Xerces 1.1.2 to version 1.1.3. = If you want to use Xerces 1.1.2 you have to add the following lines at = the beginning of endElement(): if (!uri.equals(my_uri)) { super.endElement(uri,name,raw); return; } int pos =3D name.indexOf(":"); // THIS PATCH IS = NEW if (pos !=3D -1) name =3D name.substring(pos+1); I don't know if the Xerces bug is known to the Xerces development team = as the mailinglists are currently still down. Perhaps someone in this = list can give them a hint. Regards Carsten Ziegeler Open Source Group sunShine - Lighting up e:Business =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn www.sundn.de mailto:cziegeler@sundn.de=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------------------------------------------------------------------------------------------ ...this mail was scanned for viruses by mailserver...