ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <latch...@gmail.com>
Subject Re: bug in DOMElementWriter
Date Sat, 26 Jun 2010 23:54:58 GMT
So, here is what I'm trying to do... I'm including some XML which is
generated by Eclipse as part of the .launch config files for launch
profiles. That XML has &#10; in an attribute value.

I'd expect to be able to put whatever into an <echoxml> element and have it
output back out. I shouldn't have to double encode it. It doesn't matter
that the ant build file is also xml because the error is clearly in
DOMElementWriter.encode().
It encodes other stuff, but not &#*; entities.

For example, attr="&amp;" comes out as attr="&amp;" and not attr="&"... I
don't have to write attr="&amp;amp;" to get what I want. The same is true
with attr="&gt;"... it comes out as attr="&gt;" instead of attr=">". This is
all because DOMElementWriter.encode() is smart about those entities.

attr="&#10;" should come out as attr="&#10;", not attr="\n"

jon

On Sat, Jun 26, 2010 at 12:07 PM, Antoine Levy-Lambert <antoine@gmx.de>wrote:

> Hello Jon,
>
> do not forget that the ant build file is also written in xml.
>
> To do what you want, you need to write this :
>
> <echoxml>
>  <test attr="&amp;#10;" />
> </echoxml>
>
>
>
> Jon Stevens wrote:
> > Here is a better example:
> >
> > <?xml version="1.0"?>
> > <project name="test" basedir=".">
> > <echoxml>
> >  <test attr="&#10;" />
> > </echoxml>
> > </project>
> >
> > [8][ //tmp ]% ant
> > Buildfile: build.xml
> > <?xml version="1.0" encoding="UTF-8"?>
> > <test attr="
> > " />
> >
> > BUILD SUCCESSFUL
> > Total time: 0 seconds
> >
> > Not what I was expecting.
> >
> > jon
> >
> >
> > On Fri, Jun 25, 2010
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message