<import>

The <import> element makes an entire <library> of <block> statements available to a macro.

Description

The <block> statements you import must be defined in a <library>. A <library> can be defined in your current query or stored as part of a Quick Query. If you need a <block> from a <library> defined outside your current query, you must use <import> to make that library available in your current query.

Syntax

<import path="[PATH_TO_LIBRARY]"/>

Attributes

path
The name or ID of the query from which the libraries will be imported.
once
Accepts an integer value of 0 or 1 that specifies whether libraries from a path that has already been imported to the current context should be reloaded.

When once="1", libraries are not reloaded if the specified path has already been imported.

The default is 0.

(Available as of version 10.18)

Example

For this example, assume that the following <library> is saved as a Quick Query in pub.demo.retail.selectionlib:

<library>
    <block name="storeSelection" storechoice="1">
        <sel value="store={@storechoice}"/>
    </block>
</library>

You can then import this <library> into your current query and call the block it contains using the <insert> operation.

<base table="pub.demo.retail.item"/>
<import path="pub.demo.retail.selectionlib"/>

<insert block="storeSelection" storechoice="2"/>
Note: The base table is pub.demo.retail.item.