3 Replies Latest reply on Oct 24, 2013 10:15 PM by Sajeev Sridharan

    Moving an xmlElement to make it the child of another

    jbraxx

      Hi all,

       

      I'm looking for a solution to move one xmlElement so that it becomes the child of another.  For example, the current structure is:

       

      <Root>

           <Story>

           <Article>

       

      And I'd like to move the Story element to make the structure:

       

      <Root>

           <Article>

                <Story>

       

      I've tried various methods:

      • Story.move(LocationOptions.AT_BEGINNING, Article)
      • Article.markup(Story)
      • Story.markupTag = Article)
      • app.activeDocument.xmlElements[0].xmlElements.add("Article", Story)

       

      In these examples, "Story" and "Article" are variables that contain the appropriate XML element.

       

      None of those attempts has worked.  Is there a scripting solution to make one XML element the child of another?

       

      Thanks!