XML Script logo next up prev
Root specifier
Description

An item list may specify an item relative to the current element, or relative to the root element. The '\' character at the start of an interpolation is used to specify an item list relative to the root element.

On the data side, the root element is always the same - it is a meta-element called __data_root. Whatever template you are in, '\' always refers to this element.

On the template side, the root element is the current template (i.e., the XST element or the _template element you are in). Since each template has its own namespace, you cannot normally address elements in one template from within another template. However, there are two mechanisms which allow you to do this. Firstly, the '..' syntax lets you refer to the parent template. If the _template is nested within other constructs, then the '..' syntax will jump past these element levels to the next template above. Usually, this will be the root template, that is, the main XST element. Alternatively, there is a template specifier mechanism, described further on.

Note that '..' is also used in an item list to refer to a parent of an element, as described further on.

Example

Syntax:

foo

The foo sub-element of the current data element

Example

Syntax: \

\foo

The foo sub-element of the data root

Example

Syntax: $\

$\foo

The foo sub-element of the current template

Example

$\..\foo

The foo sub-element of the parent template of the current template

Example

$\..\..\foo

The foo sub-element of the grandparent template of the current template

Next...

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited