Jstl Xml If Tag
π
2026-06-18 | π JSTL
# Tag
[JSP Standard Tag Library](#)
The `` tag is used to evaluate the value of an XPath expression. If the value is true, the content within its body is executed; if false, the body content is ignored.
### Syntax Format
<x:if select="" var="" scope=""> ...
### Attributes
The `` tag has the following attributes:
| **Attribute** | **Description** | **Required** | **Default Value** |
| --- | --- | --- | --- |
| select | The XPath expression to evaluate. | Yes | None |
| var | The variable to store the condition result. | No | None |
| scope | The scope of the var attribute. | No | Page |
* * *
## Example
The following example demonstrates how to use the `` tag:
JSTL x:if TagBooks Info:
Padam History ZARA 100 Great Mistry NUHA 2000 Document has at least one element.
100"> Book prices are very high
The result is as follows:
BOOKS INFO:Document has at least one element. Book prices are very high
* * JSP Standard Tag Library](#)