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 46643 invoked from network); 6 Feb 2003 23:07:15 -0000 Received: from unknown (HELO wsmail3.firstam.com) (208.246.101.197) by daedalus.apache.org with SMTP; 6 Feb 2003 23:07:15 -0000 Received: from 172.21.131.5 by wsmail3.firstam.com with ESMTP (Mail (MMS v4.7);); Thu, 06 Feb 2003 15:07:00 -0800 X-Server-Uuid: 645df872-acb9-4cc6-8334-84a82cbe044d Received: from mailhost.res.firstam.com ([192.168.173.10]) by famarp01.firstam.com (Mirapoint Messaging Server MOS 3.2.0.52-EA) with SMTP id AXK12621; Thu, 6 Feb 2003 15:26:32 -0800 (PST) Received: by mailhost.res.firstam.com with Internet Mail Service ( 5.5.2653.19) id ; Thu, 6 Feb 2003 15:06:58 -0800 Message-ID: <6143B7F7EAA5D411B51E0090278878F6CF1ADB@sacexc01.ti.transamerica.com> From: "Baltz, Kenneth" To: "Jakarta Commons Users List" Subject: RE: Digester Newbie Question Date: Thu, 6 Feb 2003 15:07:46 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) X-WSS-ID: 125C351E6947279-02-01 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2CE34.8FD5A600" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C2CE34.8FD5A600 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Digester 1.4 was released this week. You might give it a try. I don't see anything immediately wrong with your example, but I'm not familiar with using a validating parser or namespaces. K.C. -----Original Message----- From: Kim Scott [mailto:kims@cup.hp.com] Sent: Thursday, February 06, 2003 2:02 PM To: commons-user@jakarta.apache.org Subject: Digester Newbie Question Hi, I am having a problem using digester 1.3 to parse element text. Digester always returns the empty string for the element text. No exceptions are thrown and the logging doesn't show any error messages. Attributes work fine for me. I tried digester 1.2 and then both work. Does anyone have any suggestions on what could be going wrong when I try 1.3? I'd like to use 1.3 so I can use a schema for validation. The code follows. Thanks very much, Kim Here is the code. I changed it to no longer set the schema when I switched to 1.2. private static EmailContent parseEmailContent(String emailXmlString) throws Exception { // Create reader for email xml string StringReader reader = new StringReader(emailXmlString); // Create digester Digester digester = new Digester(); digester.setValidating(true); // Setup Parse Rules digester.addObjectCreate("Email", EmailContent.class); digester.addCallMethod("Email/Subject", "setSubject", 0); digester.addCallMethod("Email/Body", "setBodyText", 0); // Parse the configuration file EmailContent emailContent = (EmailContent)digester.parse(reader); return(emailContent); } // parseEmailContent Here's a sample of the xml: Critical Alert Oracle Financial System is impacting Order Flow. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org ------_=_NextPart_001_01C2CE34.8FD5A600--