This content has been marked as final. Show 3 replies
i have tried the above one but it remove the complete structure the thing is my root element is associated with a text frame and i want to untag it.
Manually i am able to do it by selecting the text frame and by clicking the Untag button from "Windows>Tags" palette. This when done deletes all the XML structure except the root element which is now not associated with any text frame but still exists.
I would do these actions through scripting.
If the text frame is associated with the root, then you have other problems--really, the root should never be associated with a page item. Here's something that will untag the currently-selected frame:
var myMenuAction = app.menuActions.item("Untag Frame");
Note, however, that invoking menu items is not a good way to work with scripting. This script will probably also fail in localized versions of InDesign--you'll have to mess with a translated key string (as described in the Scripting Guide) for it to work everywhere.