Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 26841 invoked by uid 98); 8 Jan 2003 00:07:07 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 26822 invoked from network); 8 Jan 2003 00:07:05 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 8 Jan 2003 00:07:05 -0000 Received: (qmail 97721 invoked by uid 500); 8 Jan 2003 00:05:41 -0000 Received: (qmail 97713 invoked from network); 8 Jan 2003 00:05:40 -0000 Received: from lml106.siteprotect.com (66.113.136.241) by daedalus.apache.org with SMTP; 8 Jan 2003 00:05:40 -0000 Received: from xRemedy (pcp575685pcs.wilmsc01.tn.comcast.net [68.52.74.243]) by lml106.siteprotect.com (8.11.6/8.11.6) with ESMTP id h0805ik20235 for ; Tue, 7 Jan 2003 18:05:44 -0600 From: "Kevin Ross" To: Subject: [Betwixt] reading/writing xml with existing @id attribute Date: Tue, 7 Jan 2003 18:05:38 -0600 Message-ID: <002001c2b6a9$add91ad0$6501a8c0@xRemedy> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0021_01C2B677.633EAAD0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0021_01C2B677.633EAAD0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit First, I'm new to Betwixt, but by no means new to the Digester. I've used the Digester successfully for several projects. I'm having a problem. I cannot figure out how to have my existing xml be read/written properly (without a betwixt file), when my XML root element already contains an attribute @id and also has (what Betwixt classifies as a 'primitive') an element , which is a String. For example: XYZ LLC Tester: BeanReader reader = new BeanReader(); XMLIntrospector x = new XMLIntrospector(); x.setElementNameMapper(new DecapitalizeNameMapper()); x.setAttributesForPrimitives(false); reader.setXMLIntrospector(x); reader.registerBeanClass( Customer.class ); The problem lies in the x.setAttributesForPrimitives(true);. This works for @id, but not for , or vice versa when set to false when Customer.java is: public class Customer{ private String id; private String name; . } I know I can do the following and make it work, but this is somewhat bothersome since I have to do this for every entity with an id: How can I get both @id and to be read/written properly programmatically, exactly as the source file shows? It would be easier for me to specify an AttributeDescriptor generically, instead of providing a betwixt file for all of them. Am I missing something here? Thanks, Kevin Ross ------=_NextPart_000_0021_01C2B677.633EAAD0--