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 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="&" 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" jon On Sat, Jun 26, 2010 at 12:07 PM, Antoine Levy-Lambert <anto...@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="&#10;" /> > </echoxml> > > > > Jon Stevens wrote: > > Here is a better example: > > > > <?xml version="1.0"?> > > <project name="test" basedir="."> > > <echoxml> > > <test attr=" " /> > > </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-unsubscr...@ant.apache.org > For additional commands, e-mail: dev-h...@ant.apache.org > >