4 Replies Latest reply on Feb 24, 2009 9:32 AM by Tomasz Bujlow

    XML Tags - why I need to export and import XML source?

    Tomasz Bujlow Level 1
      Hi all,

      I have got problem with updating XML Tags. When some textframe is tagged and I would like to change content of this, I can simply do:

      rootElement.xmlElements[0].contents = "new text";

      and this is working as expected - immediatley after this text content is changed. But when I try to change image in image box associated with tag by:

      rootElement.xmlElements[1].xmlAttributes[0].value= "path_to_image";

      this is not working sirectly. Simply, "href" value is updated, but some internal links still direct to old image link. I have to do this:

      var tmpFile = File(tmpPath + "docum.xml");
      myDocument.exportFile(ExportFormat.xml, tmpFile);
      myDocument.importXML(tmpFile);

      After exporting and importing XML content, links are updated and ecerything works fine. Can I simply update these links and do everything without exporting and importing back this xml content?