3 Replies Latest reply on Oct 27, 2008 2:41 PM by (Jim_Bertelsen)

    How to add Parent tag?

      Hi All,

      Anyone please help how to add the parent tag for the already tagged contents?

      Thanks,

      ArcRaj.
        • 1. Re: How to add Parent tag?
          Level 1
          Hi ArcRaj,

          Add a new XML element to the parent of the existing structure, then move the element or elements into the next element using the move method.

          Thanks,

          Ole
          • 2. Re: How to add Parent tag?
            Level 1
            Thanks Ole, I know how to tag the child element like xmlElements[0].xmlElements[0], etc. but I don't know how tag contents as a parent.

            Thanks,

            ArcRaj
            • 3. Re: How to add Parent tag?
              Suppose you have xml tags in a paragraph like this, and those tags are separated by text as in this example.

              If you create a parent tag for the first element, then move the second tag to the end of the parent of the first tag, the text within the second term will move with it, which is not the desired result.

              1) Is there a Javascript command to duplicate the "New Parent Element..." command found in the structure pane context menu when right clicking on one or more elements?

              2) If so, how can you specify the name of the parent tag to be applied to multiple xml tags?

              NOTE: The following code will access the dialog, but I don't know how to select a tag within the dialog, or how to bypass the dialog altogether and just do something like "with selected tags, apply New Parent Element named whatever."

              myDocument.xmlElements.itemByName("glossTerm").select();
              app.menuActions.item("$ID/Structure_InsertParentTagDialog").invoke();