2 Replies Latest reply on Mar 20, 2015 1:21 PM by beh_gras_beh

    Move XML tags

    beh_gras_beh Level 1

      Dear Indesign users,

       

      I have this XML.

      <Workbook>  
        <Element_01>  
        <Tag_01>
        <Indesign_01></Indesign_01>  
        <Indesign_02></Indesign_02>
        </Tag_01>
        </Element_01>
        
        <Element_02>  
        <Tag_02>
        <Indesign_02></Indesign_02>  
        <Indesign_02></Indesign_02>
        </Tag_02>
        </Element_02>
        <Container_01>  
        </Container_01>
        <Container_02>  
        </Container_02>
      </Workbook> 
      

       

      With this script I can move tags.

      var root = app.activeDocument.xmlElements[0];  
      root.xmlElements.item("Element_01").move(LocationOptions.AT_END, root.xmlElements.item("Container-01")); 
      

       

      But I want <Indesign_01> out of <Tag_01> and place it in <Container_01>. Like this:

      <Workbook>  
        <Container_01>  
        <Element_01></Element_01>
        <Tag_01></Tag_01>
        <Indesign_01></Indesign_01>  
        <Indesign_02></Indesign_02>
        </Container_01>
      </Workbook> 
      

       

      Is this possible?