Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Doc Import Param to suppress XML import validation message

New Here ,
Aug 31, 2014 Aug 31, 2014

Hi,

I'm running a script where the first part is to import an xml document, then to make some changes to the imported xml.

Problem is, the xml may not always be valid. If it isn't I would like to still make the changes regardless.

Unfortunately, my code is not running as I end up with "Validation of XML file failed. Continue? " prompt.

Can I somehow suppress this ?  or is there a way to send the OK key hit - so my code can just continue without requiring any user interaction ?

var importParams = GetImportDefaultParams();

                         i=GetPropIndex(importParams,Constants.FS_ImportAsType);

                        importParams.propVal.ival=Constants.FV_TYPE_XML;

                         i=GetPropIndex(importParams,Constants.FS_FileIsXmlDoc);

                        importParams.propVal.ival=Constants.FV_DoOK;

                        i=GetPropIndex(importParams,Constants.FS_AlertUserAboutFailure);

                        importParams.propVal.ival=0;

                         i=GetPropIndex(importParams,Constants.FS_DontNotifyAPIClients);

                        importParams.propVal.ival=1;

                       // var importParams = GetImportDefaultParams();

                        i=GetPropIndex(importParams,Constants.FS_HowToImport);

                        importParams.propVal.ival=Constants.FV_DoByCopy;

                        var returnParams = new PropVals() ;

                alert("importing");

                        doc.Import (doc.TextSelection.end , filename, importParams, returnParams);

             app.ActiveDoc = doc;

do_something_else();

thanks!

Tracey

TOPICS
Scripting
421
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2014 Sep 01, 2014
LATEST

Hi,


Have you already tried to suppress the alert?

There is an example of this in the FrameMaker installation.

FM_Suppress_Alerts.jsx

ScriptsAndUtilities\Suppress Alerts

Regrads,

Apollo

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines