When you add a repository item with the <add-item>
tag, you can use the tag
attribute in place of the id
attribute. If you use a tag
attribute, the SQL repository chooses a unique repository ID for the item using the IdGenerator
and associates that tag with that ID. You can then refer to that particular tag name within that .XML file with a tag
attribute. Alternatively, refer to the tag with this special syntax:
$tag:<name>$
The $tag:<
name
>$
syntax can be used only in:
the
value
attribute or body of a<set-value>
tagthe
query
attribute or the body of a<query-items>
tag
The template parser substitutes the ID of the item you created with that tag.
For example, you might want to add an item, one of whose properties is another repository item—for example, a book
item, where the book
item has an author
property which is itself a repository item. If you do not want to supply the repository ID for the author
repository item, you can use a tag
attribute placeholder like this:
<add-item item-descriptor="author" tag="AUTHORID_TAG"> <set-property name="authorName" value="Arthur Ransome"/> ... </add-item> <add-item item-descriptor="book"> <set-property name="title" value="Swallows & Amazons"/> <set-property name="author" value="$tag:AUTHORID_TAG$"/> </add-item>