1 Reply Latest reply on May 16, 2014 12:44 AM by Gejaraja

    Moving xmlElement inside another


      Hi (again )


      I must be too tired and miss something. What's the problem with this script ?



      var myStartIndex = myFindTexts[i].insertionPoints[-1].associatedXMLElements[0];

      var myBlocktoBuild = myFindTexts[i].insertionPoints[-1].associatedXMLElements[0].parent.xmlElements.add(savedBlockFindPrefs[counter][1]);

      myBlocktoBuild.move(LocationOptions.BEFORE, myStartIndex);

      alert(myBlocktoBuild + "   " + myStartIndex);

      myStartIndex.move(LocationOptions.UNKNOWN, myBlocktoBuild);




      myFindTexts[i] is a result of a findText method.

      Line 2 and 3 are ok (new xmlElement well add and move before myStartIndex

      Line  4 is returning 2 xmlElement

      But the script never reach the alert() of line 6 ?!


      So do you have any idea why I cannot move a xmlElement into another one ?


      Have a nice day,