Processes its template content if given model node exists in the model.
The tag uses the specified query expression to navigate the model and retrieve the nodes matching the query expression. If the query expression resolves to one or more nodes then the tag's template content is processed.
If the attr attribute is specified, then at least one of the retrieved nodes must have an attribute by that name in order for the template content to be processed.
Tag Summary | |
---|---|
required |
<exists node="value" /> |
full tag |
<exists node="value" attr="value" useName="value" /> |
Required Attributes |
|
---|---|
node | A query expression that resolves to some number of nodes in the model |
Optional Attributes | |
---|---|
attr | The name of an attribute that must be present in at least one of the nodes matching the query expression in order for the template content to be processed. |
useName | A name to associate with the first of the retrieved model nodes. This name is un-associated from the model node when the template content has finished processing. Use of this attribute provides for an easy way for nested template tags to refer to the first node that matched the query expression. |
Example | |
---|---|
<exists node="tag/attribute" attr="key" useName="key-attribute" > content </exists> This exists tag will retrieve all of the attribute child nodes of the model node currently associated with the name "tag". Since the attr attribute was specified, that collection of nodes is filtered so that only those nodes with an attribute named "key" remain. If any nodes remain in this collection (filltered only if the attr attribute is specified), then the first node in that collection is associated with the name "key-attribute" and the template contents of the exists tag is processed. Once the template processing completes, the variable name "key-attribute" is un-associated with that node. |
© Copyright IBM Corporation 2000,
2006. All Rights Reserved.