Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 11608 invoked from network); 29 Feb 2004 00:10:36 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 29 Feb 2004 00:10:36 -0000 Received: (qmail 89289 invoked by uid 500); 29 Feb 2004 00:10:16 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89267 invoked by uid 500); 29 Feb 2004 00:10:16 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 89252 invoked from network); 29 Feb 2004 00:10:15 -0000 Received: from unknown (HELO mail.uni-magdeburg.de) (141.44.1.10) by daedalus.apache.org with SMTP; 29 Feb 2004 00:10:15 -0000 Received: from sunny.urz.uni-magdeburg.de ([141.44.8.7]) by mail.uni-magdeburg.de with esmtp (EXIM Version 4.30) for id 1AxEXD-0001j8-Jo; Sun, 29 Feb 2004 01:10:19 +0100 Received: from amdamm42 (wh58-409.st.Uni-Magdeburg.DE [141.44.198.49]) by sunny.urz.uni-magdeburg.de (8.12.10/8.12.10) with SMTP id i1T0AA26002601 for ; Sun, 29 Feb 2004 01:10:10 +0100 Message-ID: <001301c3fe58$8983f6d0$31c62c8d@amdamm42> From: "Martin Kersten" To: Subject: [Digester 1.5] Pattern matching screwed me up Date: Sun, 29 Feb 2004 01:11:10 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0010_01C3FE60.EB1D7E40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Score: -1.4 (-) X-Spam-Report: ---- Start SpamAssassin results -1.4 points, 5.0 required; 0.1 HTML_MESSAGE BODY: HTML included in message -1.5 BAYES_01 BODY: Bayesian spam probability is 1 to 10% [score: 0.0254] ---- End of SpamAssassin results X-Scan-Signature: f8eca9bdaaaaa93ddb663bc716727d98 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0010_01C3FE60.EB1D7E40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi maillist, after I've tried for hours to get my simple XML shema working=20 (due to bad documentation if you ask me). I nearly give up. My problem? Well I want to use selfcontainment. Given you=20 an example:=20 So whats the problem? First of all this wont work: digester.addObjectCreate("a",A.class); digester.addObjectCreate("b",B.class); =20 digester.addSetNext("a/a","add"); digester.addSetNext("a/b","addB"); Why does this wont work? Well took me an hour to figure it out (thanks for the hidden java doc documentation -why not pointing it out in a seperate documentation file? Like everyone does?) Ok here you go, just add an */ to match everything... digester.addObjectCreate("*/a",A.class); digester.addObjectCreate("*/b",B.class); =20 digester.addSetNext("*/a/a","add"); digester.addSetNext("*/a/b","addB"); Looks right, doesn't it? Well not for digester, it seams! Since=20 */a/a is a closer pattern match it seams, adding it is just more=20 important then creating the object first (who cares null pointer?!). Ok therefore lets add a hack: =20 digester.addObjectCreate("*/a",A.class); digester.addObjectCreate("*/b",B.class); =20 digester.addObjectCreate("*/a/a",A.class); digester.addObjectCreate("*/b/a",B.class); =20 digester.addSetNext("*/a/a","add"); digester.addSetNext("*/a/b","addB"); Works! But halt, bad karma... . If you have something like setProperties("*/a","id","id"); You can collapse right now. Since */a is not as exact as */a/a it would not be called right out of the box (setNext will be called first). So what to do?=20 Adding another setProperties("*/a/a","id","id")?=20 Would fix it! Crazy. It seams I've missed an important information. Can someone=20 shade some light? I dont want to blaim digester but I am trying=20 for hours. I wanted to save time but who could know that=20 digester hates tags containing itself. (anyone like trees?).=20 I can not imagen that simple trees are beyond the caps of digester. So I am thinking the fault is just on my side.=20 So please, tell me what am I doing wrong?! Thanks=20 Martin (Kersten) PS: Tried for more then four hours fooling around with test cases, = looking=20 for the internet and debugging the digester api. I am just a little, = well lets=20 call it disapointed... . ------=_NextPart_000_0010_01C3FE60.EB1D7E40--