Javatpoint Logo
Javatpoint Logo

XSLT <xsl:if> Element

The XSLT <xsl:if> element is used to specify a conditional test against the content of the XML file.


Parameter explanation

test: It specifies a condition in xml data to test.


XSLT <xsl:if> Element Example

Let's take an example to create a table of element with its attribute "id" and its child <firstname>, <lastname>, <nickname>, and <salary> by iterating over each employee. Let's take a condition which takes salary to be greater than 15000 and then prints the employee's details.

Employee.xml

Employee.xsl

Output:

XSLT Xsl if element 1
Next TopicXSLT <choose>




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA