2 Replies Latest reply on Feb 4, 2013 8:04 AM by AaronKuehn

    Apply an existing XML Tag To Current Object JS (JavaScript)

    AaronKuehn Level 1

      I'm working on a JavaScript to automatically tag the currently-selected object.

       

      I first check to see if the desired tag already exists -- if not I create it:

                var myXMLElement = myDocument.xmlElements[0].xmlElements.add(tagType);

      Then assign it to the currently-selected object:

                mySelection.markup(myXMLElement);

       

      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?

       

      Thanks much!