Altova XMLSpy 2024 Enterprise Edition

To export data to text, carry out the steps below:

 

1.Use a TextImportExportSettings object and set the necessary properties.

2.Fill an ExportSettings object with the required values. See Item 2 in Export to database.

3.Build an element list with Document.GetExportElementList. See Item 3 in Export to database.

4.Call Document.ExportToText to execute the export.

 

 

objExpSettings = objSpy.GetExportSettings();
objExpSettings.ElementList = objImpDocFromText.GetExportElementList(objImpDocFromText.RootElement, objExpSettings);
 
objTextExp = objSpy.GetTextImportExportSettings();
objTextExp.HeaderRow = true;
objTextExp.DestinationFolder = "C:\\Temp";
 
try
{
 
      objImpDocFromText.ExportToText(objImpDocFromText.RootElement, objExpSettings, objTextExp);
}
catch(err)
{
  WScript.Echo("Error exporting to text.\" +
                    "Error: " + (err.number & 0xffff) + "\" +
                    "Description: " + err.description);
}

 

 

The JScript code listed above is available in the sample file ImportExport.js (see Example Files).

© 2017-2023 Altova GmbH