0 Replies Latest reply on Oct 22, 2014 4:31 AM by DavidFdezGlez

    Data Truncate document.importXML()

    DavidFdezGlez

      Hello,

       

      after opening an InDesign Template, and importing  XML, the new content has less data than the original one.

       

       

      The content that is truncated is a texFrame with 2 columns.

       

      The original template has some tags to match the xml :

      dates and airports. If the dates are too long, the match still works, but then some data is truncate, and there is no overflow red signal.

       

       

      var advertDoc;
      var location = "path to template";
      var xmlLocation = "path to xml file";
      try {
          var templateFile = File(location);
          var xmlTemplate =  File(xmlLocation);
      
      
           if(templateFile.exists && xmlTemplate.exists) {
         
              advertDoc = app.open(templateFile);
             // here I can see all the data  
              //set import xml options
              var xmlImportPreferences = advertDoc.xmlImportPreferences;
              xmlImportPreferences.importStyle = XMLImportStyles.mergeImport;
              xmlImportPreferences.createLinkToXML = false;
              xmlImportPreferences.allowTransform = false;
              xmlImportPreferences.repeatTextElements = false;
              xmlImportPreferences.ignoreUnmatchedIncoming = true;
              xmlImportPreferences.ignoreWhitespace = true;
              xmlImportPreferences.importCALSTables = true;
              xmlImportPreferences.importTextIntoTables = false;
              xmlImportPreferences.importToSelected = false;
              xmlImportPreferences.removeUnmatchedExisting = true;
              xmlImportPreferences.repeatTextElements = true;
              advertDoc.importXML(xmlTemplate);
              // some data missing
          }
      } catch (err) {
      
      }
      

       

       

       

       

      Also when I use the duplicate function for a Group some data get lost

       

       var module = moduleDoc.layers.itemByName("Modules").groups[0];
       var duplicatedModule = module.duplicate(templateDoc.layers.itemByName("Modules"));  
      

       

      moduleDoc and templateDoc are well formed, and have all the necessary elements.

       

      So my question are:

       

       

      1) Is there any restriction on importXML and duplicate functions for the amount of data?

      2) Why I can not see any error signal?

       

       

      Thanks in advanced.