Igor,

  thx for your answer, but i think something isnt clear...

  my problem is on the += operator in this line of code:

                   xgravar.root.request += XMLLC;


  the XMLLC object is declared as:

                <mx:XMLListCollection id="XMLLC" 
collectionChange="collectionEventHandler(event)"/>

and have, at the time this line of code fire, the follow XML

<TipoVeiculo Id="1" Nome="Moto" Descricao="desc">
<TipoVeiculo Id="2" Nome="Carro" Descricao="desc">
<TipoVeiculo Id="3" Nome="Caminhao" Descricao="desc">
<TipoVeiculo Id="4" Nome="Aviao" Descricao="desc">

just that. (without a root node).

the root node is at "xgravar.request".

but, when i do:

xgravar.root.request += XMLLC;

and after Alert.show(xgravar.toXMLString()) the code is changed to:

<ds>
  <root>
    <request>
      &ltTipoVeiculo Id="1" Nome="Moto" Descricao="desc"&gt
      &ltTipoVeiculo Id="2" Nome="Carro" Descricao="desc"&gt
      &ltTipoVeiculo Id="3" Nome="Caminhao" Descricao="desc"&gt
      &ltTipoVeiculo Id="4" Nome="Aviao" Descricao="desc"&gt
    </request>
  </root>
</ds>

i have made a workaround for this with the follow code:

for each( var item : XML in XMLLC ) {
                XML(xgravar.root.request).appendChild(item);
            }

but i think that the += operator SHOULD do the same thing WITHOUT 
changing the < and > simbols.

dont you agree?

best regards to you!

             Luís Eduardo.



Igor Costa escreveu:

> Hi Luiz
>
>
> Isn't the operator that's wrong, you just missed out how to pass 
> String and concatening in both side of wall.
>
> Check out this heck of how could be done.
>
> public function myList():void
> {
>            var myXML = new 
> XMLList("<dsRQ><root><request/></root></dsRQ>");
>            szCommand = "insert";
>            if( [EMAIL PROTECTED] = szCommand == true)
>               {
>                   Alert.show(xgravar.toString());
>                }
>                  else {
>                      Alert.show(xgravar);
>               }
> }
>
>
> The problem is, you are trying to convert an object twice in time in 
> the same function, that's why the problem happens. if you put anything 
> in braces <> than you convert to string, the compiler intend to 
> undrestand that, "ok the users now want to convert that cacharecter".
>
>
> Regards.
>
> szCommand = "insert";
> [EMAIL PROTECTED] = szCommand;
>
> Alert.show(XMLLC.toXMLString()); // OK here. all < and >
> works fine
>
> xgravar.root.request += XMLLC;
>
> Alert.show(xgravar.toXMLString()); // ERROR here. < and >
> converted to &lt and &gt
> }
>
>
>
>
>
>
>
> On 10/24/06, *Luis Eduardo* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>     hi,
>
>     In my app, when i use the += operator, the data inside xmls turns
>     with
>     diferent encoding.
>     The < and > caracters become wierds like &lt and &gt respectively.
>
>     How can i fix this?
>
>     this is the code:
>
>     public function doGravar():void {
>     var xgravar:XMLList = new
>     XMLList("<dsRQ><root><request/></root></dsRQ>");
>
>     szCommand = "insert";
>     [EMAIL PROTECTED] = szCommand;
>
>     Alert.show(XMLLC.toXMLString()); // OK here. all < and >
>     works fine
>
>     xgravar.root.request += XMLLC;
>
>     Alert.show(xgravar.toXMLString()); // ERROR here. < and >
>     converted to &lt and &gt
>     }
>
>     where XMLLC : XMLListCollection and szCommand : String.
>     The first Alert will show correct data but the second will show
>     caracters converted.
>
>     regards,
>
>     Luís Eduardo.
>
>
>     _______________________________________________________
>     Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu
>     celular. Registre seu aparelho agora!
>     http://br.mobile.yahoo.com/mailalertas/
>     <http://br.mobile.yahoo.com/mailalertas/>
>
>
>
>
>
> -- 
> ----------------------------
> Igor Costa
> www.igorcosta.com <http://www.igorcosta.com>
>  



                
_______________________________________________________ 
O Yahoo! est� de cara nova. Venha conferir! 
http://br.yahoo.com


--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to