2 Replies Latest reply on Jan 14, 2011 3:23 AM by JohnDevlon

    [CS4][JS] Swap xml content results in duplicate content

    JohnDevlon Level 1

      Hi,

       

       

      Does anyone have a solution for this problem?

       

      I would like to swap 2 xml text contents. The result is a duplicate content, what I don't want.

       

      The text is in element 0 = "ABC". The text in element 1 = "123".

      The result is twice the same text.

       

       

       

      var myFirstElm = myCurrentElement.xmlElements[0].contents;

      var mySecElm = myCurrentElement.xmlElements[1].contents;

       

      myCurrentElement.xmlElements[1].contents = myFirstElm;

      myCurrentElement.xmlElements[0].contents = mySecElm;

       

       

       

       

      I think the values in myFirstElm and mySecElm are just pointers to memory location of the originals. This would explain the result.

      In some other programming languages known as "ByRef".

       

       

      Is it possible to swap the content? How do I resolve this issue?

       

      Thanks for any feedback

       

      John