Return-Path: X-Original-To: apmail-maven-dev-archive@www.apache.org Delivered-To: apmail-maven-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1FA96EF3 for ; Tue, 2 Aug 2011 22:22:53 +0000 (UTC) Received: (qmail 1127 invoked by uid 500); 2 Aug 2011 22:22:53 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 1026 invoked by uid 500); 2 Aug 2011 22:22:52 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 1018 invoked by uid 99); 2 Aug 2011 22:22:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2011 22:22:52 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [204.13.248.74] (HELO mho-02-ewr.mailhop.org) (204.13.248.74) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2011 22:22:46 +0000 Received: from adsl-074-170-244-147.sip.gnv.bellsouth.net ([74.170.244.147] helo=betelgeuse.commonjava.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72) (envelope-from ) id 1QoNM1-0004Lw-9Z for dev@maven.apache.org; Tue, 02 Aug 2011 22:22:25 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 74.170.244.147 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1//eJoPBu2H5or3BetFmSlK Message-ID: <4E38789E.2000008@commonjava.org> Date: Tue, 02 Aug 2011 18:22:22 -0400 From: John Casey User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Maven Developers List Subject: Re: POM reader that preserves CDATA? References: <4E387379.2020800@commonjava.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/2/11 6:10 PM, Benson Margulies wrote: > In general, you really can't expect to retain CDATA unless you build a > DOM tree, and maybe not then. It's a fundamental principle of XML that > CDATA isn't part of 'the infoset' -- the data that is represented by > the file. A parser is under no obligation to faithfully report this > stuff, so long as the right text ends up in the right place. > > However, forget xpp3 and all that ancient lumber. Use Woodstox, or the > Xerces DOM, and you can probably find enough options to ask it to do > what you need. yeah, that's basically what I was afraid I'd be left with...in other words, no quick and easy solution, but basically a reinvention of the model reader with a lot of extras. > > > On Tue, Aug 2, 2011 at 6:00 PM, John Casey wrote: >> Hi all, >> >> I'm working on some tooling for $dayjob that needs to manipulate POM files >> according to certain rules. >> >> The problem I'm running into is that some of the POMs it much manipulate >> contain CDATA sections, comments, etc. Also, since the modified POM often >> will be used as the basis for a patch file, I'd like to preserve as much of >> the ordering and existing whitespace in the file as possible, to minimize >> the patchfile size. >> >> I'm currently using the JDom-driven, Modello-generated writer, coupled with >> the stock XPP3-driven reader (not the best, I know). It's losing the CDATA >> (big problem) and injecting ^M (wrong line ending, little problem)... >> >> Does anyone have experience with this? Anyone maybe have an advanced POM >> reader/writer stashed somewhere that can preserve CDATA and the like? >> >> Thanks, >> >> -john >> >> -- >> John Casey >> Developer, PMC Chair - Apache Maven (http://maven.apache.org) >> Blog: http://www.johnofalltrades.name/ >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org >> For additional commands, e-mail: dev-help@maven.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org > For additional commands, e-mail: dev-help@maven.apache.org > -- John Casey Developer, PMC Chair - Apache Maven (http://maven.apache.org) Blog: http://www.johnofalltrades.name/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org