Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 12513 invoked from network); 19 Jan 2004 18:57:23 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Jan 2004 18:57:23 -0000 Received: (qmail 74273 invoked by uid 500); 19 Jan 2004 18:56:57 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 74218 invoked by uid 500); 19 Jan 2004 18:56:57 -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 74177 invoked from network); 19 Jan 2004 18:56:56 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 19 Jan 2004 18:56:56 -0000 Received: (qmail 12346 invoked from network); 19 Jan 2004 18:57:04 -0000 Received: from unknown (HELO madimc2.indra.es) (213.170.46.10) by minotaur-2.apache.org with SMTP; 19 Jan 2004 18:57:04 -0000 Received: from madarrclex5.indra.es ([192.168.10.22]) by madimc2.indra.es with Microsoft SMTPSVC(5.0.2195.5329); Mon, 19 Jan 2004 19:54:47 +0100 Received: from indra.es ([192.168.168.19]) by madarrclex5.indra.es with Microsoft SMTPSVC(5.0.2195.5329); Mon, 19 Jan 2004 19:56:22 +0100 Message-ID: <400C2832.80805@indra.es> Date: Mon, 19 Jan 2004 19:55:46 +0100 From: =?ISO-8859-1?Q?Jos=E9_Antonio_P=E9rez_Testa?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031125 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: Digester's pattern matching: bug or misunderstanding? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Jan 2004 18:56:22.0593 (UTC) FILETIME=[EE5F8B10:01C3DEBD] X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 Olaf.Meyer@nokia.com wrote: >I'm currently writing an XML config file parser using the Digester framework. I've spent quite a while debugging the digester code, since I really did not understand how digester was building the object stack. I now understand it but am wondering if this is a bug ... > >Here are the details. My XML document roughly has the following structure (strongly simplified for demonstration purposes): > > > > > > > > > > > > > > > > > > >I now have added the following rules: > > digester.addObjectCreate("*/my-sender", Sender.Class); > digester.addObjectCreate("*/managed-object", ManagedObject.Class); > digester.addObjectCreate("*/multi-dimension", MultiDimensionObject.Class); > digester.addObjectCreate("*/descriptor", Descriptor.Class); > > digester.setNextRule("*/managed-object/descriptor", "setDescriptor"); > digester.setNextRule("*/other-dimension/descriptor", "doSomethingElse"); > >With this setup the "Descriptor" object is *NOT* created, since the rules associated with the longer >"*/managed-object/descriptor" or "*/other-dimension/descriptor" matches are executed before the ObjectCreateRule which is matched by "*/descriptor". > > > have you tried adding two different creational rules with the longer matches instead of current single rule? It seems like '*/descriptor' is not matching anything >Digester now calls the "setDescriptor" method on a Sender instance instead of on a ManagedObject instance. > >I would expect Digester to create the "Descriptor" object before doing anything else with the object. It seems that digester does not handle rules in the proper order. Some rules are clearly associated with the creation (invoked in start() function) of an element (e.g. ObjectCreateRule). Other rules (e.g. SetNextRule) should be invoked after object creation (invoked in end() function). However digester does not seem to take this into account. > >Is this a bug, or do I need more clarification on how the matching patterns really influence digester's behavior? Comments are welcome. > >Olaf > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > ------------------------------------------------------------------------------------------------------------------- Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente. The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org