0 Replies Latest reply on May 5, 2014 2:49 AM by Sudha K

    Move xml elements

    Sudha K Level 1

      Hi,

       

         I need to create parent element and need to move selected elements into tat.  when doing this, paragraph style getting changed.  Dono wats my mistake there.

       

       

       

      Screen shot 2014-05-05 at 3.10.49 PM.png

      Screen shot 2014-05-05 at 3.10.36 PM.png

      Screen shot 2014-05-05 at 3.10.22 PM.png

      Code :

       

      AddParentTag(app.selection,"row", elm)

       

       

      function AddParentTag(mySel, tagName, parentTg)

      {       

          /*

              mySel   -   Selection of multiple tags

              tagName -   Name of the parent tag

          */

          var parnt = null;

          if(mySel.length > 0)

          {

               parnt = parentTg.xmlElements.add({markupTag:tagName}).move(LocationOptions.before, mySel[0]);    

              var i = mySel.length;

              if(parnt != null)

              {

                  while(i--){    

                      var resTg = mySel[i].move(LocationOptions.AT_END, parnt);                                  

                  }

                 

              }

            }

      }

       

       

       

      I want to move the elements without changing style(pstyle) of the contents. Can anyone help me?

       

       

      - Sudha K