GridSafeDocumentation/ReportTemplates/Macros/

Macros

Some reports require the same xml fragment to be re-used in multiple places (for example filter definitions). Macros allow you to define these fragments once then re-use them.

<?xml version="1.0"?>
<rep:Report 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:rep="http://safe.epcc.ed.ac.uk/report"
  xmlns:mac="http://safe.epcc.ed.ac.uk/macro">

        <mac:MacroDef name="macro_a"><bracket>igor</bracket></mac:MacroDef>
        <mac:MacroDef name="macro_b"><bracket>cuddles</bracket></mac:MacroDef>
        <mac:MacroDef name="macro_c">fred</mac:MacroDef>
        
        <Heading>Macro A</Heading>
        <mac:Macro name="macro_a"/>
        
        <Heading>Macro B</Heading>
        <mac:Macro name="macro_b"/> 

        <Heading>Macro C</Heading>
        <mac:Macro name="macro_c"/>
</rep:Report>

Macros are defined using the MacroDef element and referenced using the Macro element.

Macro expansion takes place after parameter substitution.

 

Grid-SAFE was funded by JISC and is maintained, developed, and managed by EPCC at the University of Edinburgh