FTR, I found that setting XML.prettyPrinting = false fixes this, but this is not a workaround I can use. I'm pretty sure this behavior does not comply with ECMA-357, so I logged a bug:
http://bugs.adobe.com/jira/secure/IssueNavigator.jspa?mode=hide&requestId=10201 --- Dave Glasser <[EMAIL PROTECTED]> wrote: > P.S., in the CDATA section below, the "a" character has four spaces on > either side, but it might not appear that way in HTML-based mail readers. > > > --- Dave Glasser <[EMAIL PROTECTED]> wrote: > > > That doesn't seem to work either. Perhaps I'm not doing it right, but > the > > output is identical with this code: > > > > var x:XML = <myXML/>; > > x.a = new XML( "<![CDATA[ a ]]>"); > > x.b = " b "; > > x.c = " c "; > > trace("x=" + x.toXMLString()); > > > > It doesn't show the CDATA section in the output, nor does it preserve > the > > whitespace. > > > > --- Nils Millahn <[EMAIL PROTECTED]> wrote: > > > > > Have you tried using a CDATA around them? > > > > > > - Nils. > > > > > > > > > Dave Glasser wrote: > > > > I've tried using the static XML.ignoreWhitespace property to solve > > this > > > > problem. Not only does it not work, but I don't want the setting > > applied > > > > globally. When I run this code: > > > > > > > > var x:XML = <myXML/>; > > > > x.a = " a "; > > > > x.b = " b "; > > > > x.c = " c "; > > > > trace("x=" + x.toXMLString()); > > > > > > > > The output is: > > > > > > > > x=<myXML> > > > > <a>a</a> > > > > <b>b</b> > > > > <c>c</c> > > > > </myXML> > > > > > > > > > > > > Can anyone tell me how to preserve the leading and trailing > whitespace > > > in > > > > the elements a, b and c? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Flexcoders Mailing List > > > > FAQ: > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > > > Search Archives: > > > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >