Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 46131 invoked from network); 28 Jun 2010 01:55:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jun 2010 01:55:51 -0000 Received: (qmail 78934 invoked by uid 500); 28 Jun 2010 01:55:50 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 78829 invoked by uid 500); 28 Jun 2010 01:55:50 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 78821 invoked by uid 99); 28 Jun 2010 01:55:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 01:55:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of latchkey@gmail.com designates 74.125.83.173 as permitted sender) Received: from [74.125.83.173] (HELO mail-pv0-f173.google.com) (74.125.83.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 01:55:41 +0000 Received: by pvg12 with SMTP id 12so2281264pvg.4 for ; Sun, 27 Jun 2010 18:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=Zj5dB8SagLN3Q4YiszEo8KYk6eiQn8ogsuZbkRvF0hg=; b=lXEH05zdXIn86jA60f4qELMi29cUcinTfZe4RIONYb1tJRguoNUJQkHK64CzHiIf86 h3LXRDPZc0WGqGJv1YTZ0g1xhS5KRGHf9RO7Agx1X2j+9BFwifFzf8Nd8qr1ERINlLfp 196dKcJdRaQy0TnqCJDRJTuAgOWgYC3yNNfXU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=ASIhO9EwAS6ylD7Bf5tKEy/iocgLLHdU9SalQW6ilhp/mYmWzT+arwxzJvDWr509R7 dwrBNb5n7hi/bEV0mQix178W8KSp4docI4cditbPNdkvP9PqCOHW2/NGtumpje5EFHX4 3S3HgfjrAwwQ2vF6gpb+ucMw5O7WRraxwcXDM= Received: by 10.114.159.14 with SMTP id h14mr3319042wae.113.1277690120271; Sun, 27 Jun 2010 18:55:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.115.15.19 with HTTP; Sun, 27 Jun 2010 18:55:00 -0700 (PDT) In-Reply-To: References: <4C264FE4.1050007@gmx.de> From: Jon Stevens Date: Sun, 27 Jun 2010 18:55:00 -0700 Message-ID: Subject: Re: bug in DOMElementWriter To: Ant Developers List Content-Type: multipart/alternative; boundary=001636458388c07d90048a0d69bd X-Virus-Checked: Checked by ClamAV on apache.org --001636458388c07d90048a0d69bd Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jun 27, 2010 at 10:35 AM, Dominique Devienne wrote: > On Sat, Jun 26, 2010 at 6:54 PM, Jon Stevens wrote: > > For example, attr="&" comes out as attr="&" and not attr="&"... I > > don't have to write attr="&amp;" to get what I want. The same is true > > with attr=">"... it comes out as attr=">" instead of attr=">". This > is > > all because DOMElementWriter.encode() is smart about those entities. > > > > attr=" " should come out as attr=" ", not attr="\n" > > Well, I'm afraid Antoine is right, and the comparison you make is not > "fair". > > &, <, and > are "special" in XML, and must always be encoded in > attribute values and textual content. \n is not. > > never sees the "&" text, it sees whatever the XML parser > reports, a "&", and the XML serializer Ant uses knows it must encode > that char into "&", thus it ends up back the way it was. But with > \n, which is just like any other character*, the serializer doesn't do > anything special, and the output the also contain a "plain" \n. However, the character that went into the attribute was not a \n, it was a . I'd expect ant to give me back out, not \n. The point of is to echo xml, is it not? In that case, the point here should be to echo out the encoded value as xml, not something that is useless. jon --001636458388c07d90048a0d69bd--