Skip to main content
New Participant
July 17, 2008
Question

How to add Parent tag?

  • July 17, 2008
  • 3 replies
  • 884 views
Hi All,

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

Thanks,

ArcRaj.
This topic has been closed for replies.

3 replies

New Participant
October 27, 2008
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();
_ArcRaj_Author
New Participant
July 18, 2008
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
Known Participant
July 17, 2008
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