Bookmark and Share Share

Including Macro Libraries in Mashup Scripts or Macro Libraries

You can use macros in a mashup script if they are defined within that mashup or if you include the mashup library that defines them in your mashup script.

You can also include macro libraries in other macro libraries. This allows you to structure and manage macros as needed, but easily include them in mashups or in the global macro library. You must also deploy the macro libraries in each EMML Engine reference implmentation where the macro library may be used. See Deploying Macro Libraries in an EMML Engine for instructions.

To include a macro library in a mashup script or another macro library, add <include> directly within <mashup>, <macros> or <operation>. It is a good practice to include macro libraries before you refer to any macros within that library.

For example:

<mashup name="myMashup" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.openemml.org/2009-04-15/EMMLSchema 
     ../schema/EMMLSpec.xsd" 
    xmlns="http://www.openemml.org/2009-04-15/EMMLSchema" 
    xmlns:macro = "http://www.openemml.org/2009-04-15/EMMLMacro"> 
 
  <include file="myMacroLib.emml-macros"/> 
...

The file attribute simply contains the name of the macro library file.