5 Replies Latest reply on Aug 10, 2012 5:06 PM by absqua

    [CS5-5.5][JS] Replace xml element content with user selection

    JohnDevlon Level 1



      I'm trying to write a script that replaces xml element content with a user selection.


      I have document containing a textframe with a "root" tag attached. In this frame I have 2 paragraphs, each tagged with a different tag.


      I would like to replace the content of one of the paragraphs with the content of a text selection.


      This piece of code doesn't seem to work:


      myXMLElement.xmlContent = app.selection[0];


      The problem is that almost all properties of the xmlelement (paragraphs, words, etc) are read-only.


      Does anyone have any suggestion?