I first check to see if the desired tag already exists -- if not I create it:
var myXMLElement = myDocument.xmlElements.xmlElements.add(tagType);
Then assign it to the currently-selected object:
This works fine.
However, if the desired tag ALREADY EXISTS, I'm having problems. I haven't been able to figure out how to reference the existing element with the markup call.
Can someone help me with how to do this?
pass XML tag name instead XMLElement
mySelection.associatedXMLElements.xmlElements.add("italic", mySelection);// consider italic tag exist in current active document.
That didn't quite work for me...but it put me in the right direction. I think I have it working with this snippet:
Thanks much for your help!