XML Script logo next up prev
Template specifiers
Description

Template specifiers are an advanced topic, and so if you don't understand them the first time round, don't worry. Skip ahead and re-read this section at a later date.

Within the _template element, it is sometimes useful to be able to refer to elements and attributes in another template. One way to do this is to use a template specifier.

A template specifier is used instead of a branch or root specifier, that is, at the beginning of the item list. The template specifier consists of a pair of '|' characters, which delimit a template path.

The syntax for a template path is very similar to that for an item list. Templates may occur in the template tree or (less often) in the data tree: a '$' is used to specify the template tree. As with item lists, you can use a '\' to get to the root element (the data root on the data side or the XST element on the template side), and then you may specify the path to the template you want, using the template names.

Example

Syntax: |template_specifier|item_list

|$\|.foo

The foo attribute of the root XST element - note that if you wanted the foo attribute of the current template, you could simply use $\.foo

Example

Syntax: |template_specifier|item_list

|\|.foo

The foo attribute of the main data root (note that \.foo means the same thing, and is quicker to process)

Example

Syntax: |template_specifier|item_list

|$\bar|foo

The foo sub-element of the template defined in the XST element whose name attribute is "bar"

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