Arbortext Command Language > Functions by Alphabetical Listing > stylesheet_import_xlf
  
stylesheet_import_xlf
stylesheet_import_xlf(path, flags, stats[, doc])
This function imports the XLIFF file (.xlf) found at path into a stylesheet to provide translations of generated text. Use flags to control how to process translations when certain questions occur. stats populates an array that provides information on the number of translation units that were found in the XLIFF file and updated in the stylesheet, and the number that not imported or not found in the XLIFF file. doc is optional - specify a stylesheet document or a user document with which the stylesheet is associated.
Values for the parameters are listed below:
Parameter values
Parameter
Permitted Values
path
The path to a single XLIFF file
flags
Use a value of 0 or a combination of the following values:
1
Mark translations as current when they are identical to the source
2
Import translations that are already marked as current in the stylesheet
4
Import translations when the source has changed but the target remains the same
For example, use a value of 7 to match against all the criteria.
stats
The following values are assigned to the array:
stats[‘updated’]
Number of translation units updated during the import
stats[‘rejected’]
Number of translation units not imported for one of the 3 reasons described in flags
stats[‘missing’]
Number of translation units in the stylesheet but without equivalent in the XLIFF file
stats[‘found’]
Number of translation units in the stylesheet with equivalent in the XLIFF file
stats[‘xlftotal’]
Total number of translation units in the XLIFF file
stats[‘sstotal’]
Total number of translation units in the stylesheet
doc
(Optional)
Path to the stylesheet or user document. If not specified, the function will refer to the current document.
When successful, the function will return 1, otherwise it will return 0. The function can be unsuccessful if:
Stylesheet is not found
XLIFF file cannot be opened
XLIFF file is not valid
One of more stylesheet modules is read only, preventing a translation being imported
If the function is unsuccessful because of the read-only nature of a stylesheet module, generated text in the writable modules will still be updated and the results reflected in the import statistics. If it is unsuccessful for any of the other listed reasons, all stats will be zero.
Refer to Using ACL to Import XLIFF Files in Arbortext Styler help for sample ACL demonstrating the use of this function.
Related Topics
stylesheet_gentext_lang_stats