Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 44694 invoked from network); 18 Aug 2004 13:19:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Aug 2004 13:19:29 -0000 Received: (qmail 14540 invoked by uid 500); 18 Aug 2004 13:19:18 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 14463 invoked by uid 500); 18 Aug 2004 13:19:17 -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 14447 invoked by uid 99); 18 Aug 2004 13:19:17 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received: from [202.165.102.73] (HELO web15706.mail.cnb.yahoo.com) (202.165.102.73) by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 18 Aug 2004 06:19:13 -0700 Message-ID: <20040818131908.44429.qmail@web15706.mail.cnb.yahoo.com> Received: from [210.178.24.2] by web15706.mail.cnb.yahoo.com via HTTP; Wed, 18 Aug 2004 21:19:08 CST Date: Wed, 18 Aug 2004 21:19:08 +0800 (CST) From: =?gb2312?q?Gao=20Di?= Subject: Re: [Digester]what's the difference when parsing xml files like these? To: Jakarta Commons Users List In-Reply-To: <4123172C.8010706@indra.es> MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N thx,i see,it's a good article. --- Jos�� Antonio P��rez Testa �����ģ� > Hi Gao, as always i recommed you my reference > reading: > http://www.onjava.com/lpt/a/2746 > you must use addSetProperties method. Following > changes would work! > > //digester.addCallMethod("devices/device", > "addDevice",1); > //digester.addCallParam("devices/device/name", 0); > digester.|addSetProperties|("devices/device/name", > "device"); > > > //public void addDevice(String name, ){ > public void setDevice(String name) { > Device device = new Device(name); > devices.add(device); > } > > || > > Saludos. > > Gao Di wrote: > > >i have the xml file as below: > > > > > > Gw1 > > > > > > Gw2 > > > > > >then i can use digester to parse it with this class > >it's aim it to put the to a javabean and > then > >put all to a arraylist. > >List devices = new ArrayList(); > > > >public void parsedevice(){ > >Digester digester = new Digester(); > >digester.push(this); > >digester.addCallMethod("devices/device", > "addDevice", > >1); > >digester.addCallParam("devices/device/name", 0); > >digester.parse(test.xml); > > > >public void addDevice(String name, ){ > >Device device = new Device(name); > >devices.add(device); > >} > > > >but after some consideration,i changed the xml file > >like this: > > > > > > > > > >then,the parse code doesn't work any more,anyone > can > >help me how to parse this kind of xml file? > > > >_________________________________________________________ > >Do You Yahoo!? > >150����MP3����ѣ������������ֵ��� > >http://music.yisou.com/ > >��Ů����Ӧ�о��У��ѱ���ͼ����ͼ�Ϳ�ͼ > >http://image.yisou.com > >1G����1000�ף��Ż������������ݣ� > >http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ > > > >--------------------------------------------------------------------- > >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 > > _________________________________________________________ Do You Yahoo!? 150����MP3����ѣ������������ֵ��� http://music.yisou.com/ ��Ů����Ӧ�о��У��ѱ���ͼ����ͼ�Ϳ�ͼ http://image.yisou.com 1G����1000�ף��Ż������������ݣ� http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org