XMPData_ApplyTemplate

Apply a template XMP object to a target objext.
XMPData_ApplyTemplate(targetDataRef;templateDataRef;templateActions) ➔ success
targetDataRef Text The target XMP data reference
templateDataRef Text The template XMP data reference
templateActions Longint Template actions
↩︎ success Longint Completion status: 1 on success, 0 otherwise.

Apply a template XMP data object to a target object. The template object can be used to add, replace or delete properties in the target object.

Parameter targetDataRef is the reference to the target XMP data object.

Parameter templateDataRef is the reference to the template XMP data object.

Parameter templateActions specifies how the template is applied. Each action can be applied individually or combined with bitwise or; if no action is specified, the target XMP object is unchanged.

The constants identifying the template actions are listed in the following table:

Constant Value Description
kXMPTmplClearUnnamed 16 Deletes top-level properties. Any top-level property that is present in the template (even with empty value) is retained. All other top-level properties in the working object are deleted.
kXMPTmplAddNew 8 Adds new properties to the working object if the template properties have values.
kXMPTmplReplaceExisting 2 Replaces the values of existing top-level properties in the target if the value forms match those in the template. Properties with empty values in the template are ignored. If combined with kXMPTmplClearUnnamed or kXMPTmplAddNew, those take precedence; values are cleared or added, rather than replaced.
kXMPTmplReplaceDeleteEmpty 4 Replaces values in the same way as kXMPTmplReplaceExisting, and also deletes properties if the value in the template is empty. If combined with kXMPTmplClearUnnamed or kXMPTmplAddNew, those take precedence; values are cleared or added, rather than replaced.
kXMPTmplIncludeInternal 1 Operate on internal properties as well as external properties.