Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 61788 invoked from network); 28 Oct 2008 15:44:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Oct 2008 15:44:27 -0000 Received: (qmail 32731 invoked by uid 500); 28 Oct 2008 15:44:29 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 32265 invoked by uid 500); 28 Oct 2008 15:44:28 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 32254 invoked by uid 99); 28 Oct 2008 15:44:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2008 08:44:28 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [195.242.168.1] (HELO mgate.ops.co.at) (195.242.168.1) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2008 15:43:15 +0000 Received: from smtp.ops.co.at (smtp.int.ops.co.at [172.27.0.4]) by mgate.ops.co.at (OPS Mail Gateway - authorized use only - NO UCE/UBE C=AT L=VIE) with ESMTP id A8686AFE53 for ; Tue, 28 Oct 2008 16:43:22 +0100 (CET) Received: by smtp.ops.co.at (Postfix, from userid 65534) id 994CF6E023F; Tue, 28 Oct 2008 16:43:22 +0100 (CET) Received: from [172.27.1.104] (lints2.int.ops.co.at [172.27.1.104]) by smtp.ops.co.at (Postfix) with ESMTP id 4604F6E0234 for ; Tue, 28 Oct 2008 16:43:21 +0100 (CET) Message-ID: <49073318.9060707@apache.org> Date: Tue, 28 Oct 2008 16:43:20 +0100 From: Simon Kitching User-Agent: Thunderbird 2.0.0.17 (X11/20080922) MIME-Version: 1.0 To: Commons Users List Subject: Re: parse xml with digester References: <4906DF9B.6010403@apache.org> <004801c93912$30063ec0$0402a8c0@your55e5f9e3d2> In-Reply-To: <004801c93912$30063ec0$0402a8c0@your55e5f9e3d2> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on smtp.ops.co.at X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=-4.4 required=7.0 tests=AWL,BAYES_00, LOCAL_URI_FOUND_BOL,RATWR10_MESSID,SARE_TOCC_USER,TW_VT autolearn=no version=2.64 While vtd-xml looks interesting, I don't see how it is relevant to the original question. If the input really is as trivial as the example, then perhaps just simply using the SAX api directly would be better. If the example is a simplified version of the real input to be processed (or the format might change in future), then Digester is a very good choice. It can handle the example input, and similar structures. The digester examples I pointed to show how to do this. If the java object also has to be written back out to xml, then Betwixt might be better than Digester, as digester only does xml->object. However IMO betwixt is more complicated to use, so I would suggest avoiding it unless two-way mapping really is needed. Regards, Simon jimmy Zhang schrieb: > Also you may want to try to try vtd-xml, which just releases an > extended edition supporting > 256 GB max file size > > http://vtd-xml.sf.net > > > ----- Original Message ----- From: "Simon Kitching" > > To: "Commons Users List" > Sent: Tuesday, October 28, 2008 2:47 AM > Subject: Re: parse xml with digester > > >> Digester has extensive examples. See here: >> >> http://svn.apache.org/repos/asf/commons/proper/digester/trunk/src/examples/ >> >> >> These examples are also in the digester "source distribution" download. >> >> Regards, >> Simon >> >> Peter_Ford@blm.gov schrieb: >>> If you're mapping a POJO to XML and vice-versa, I'd consider looking at >>> Commons Betwixt rather than messing with Digester directly. >>> >>> --Pete >>> >>> mteccles wrote on 10/26/2008 06:22:59 >>> PM: >>> >>> >>>> Hi, >>>> >>>> I have an XML document like follows: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Simply a nested structure of one complex element having two required >>>> attributes. >>>> >>>> I write a POJO that match this structure, what code would read the xml >>>> document and parse into the Java object? --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org