Converting XML tags to EasyCatalog Tags

EasyCatalog has the ability convert XML tags to EasyCatalog tags via a simple LUA script that maps tag attributes to the elements of a link (key, data source, field name).

The .lua script should be placed inside a folder called “Adopt Fields” in the “Scripts” folder of a data source.  The file name of the script must contain “XML” to differentiate as an XML adoption (rather than an EasyCatalog link > EasyCatalog link adoption).

When correctly installed, the script name shows up on the “Adopt Fields->” sub menu. When actioned, all the XML tags in the document are processed. Each of the XML attributes for the XML tags is passed as a named variable.

The script can return 3 strings, representing each element of a link:

  1. key – Key field value
  2. datasource – Data source name (optional).
  3. field – Name of a field.

Here’s an example: