visit
Define content to process for an object found by the parent 'visitor' tag, provided a condition is met. The contents of this tag are evaluated if the current object of the 'visitor' iteration satisfies the 'test' XPath expression.
The 'test' XPath expression is relative to the current object of the parent 'visitor' tag. If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
Note that more than one 'visit' tag may be executed for the same object identified by the parent 'visitor' tag.
Tag Summary |
required |
<c:visit test="value">
content to process if tag condition is
satisfied
</c:visit>
|
full tag |
<c:visit test="value">
content to process if tag condition is
satisfied
</c:visit>
|
Required Attributes |
test |
An expression expression, that, if true, causes the tag contents to be evaluated. |
Example |
|
<%-- traverse a model starting at $root. $cur refers to current node --%>
<c:visitor select="$root" var="cur">
<c:visit test="local-name($cur) = 'a'">
content to process of test is true
</c:visit>
... other <c:visit> tags ...
</c:visitor>
|