Javatpoint Logo
Javatpoint Logo

XSLT <xsl:apply-template> Element

The XSLT <xsl:apply-template> element is used to tell XSLT processor to find the appropriate template to apply according to the type and context of each selected node.


Parameter explanation

Index Name Description
1) select It is used to process nodes selected by XPath expressions from the list of all nodes and its children.
2) mode It is used to allow an element as specified by its qualified names to be processed multiple times, each time producing a different result.

XSLT <xsl:apply-template> Element Example

Let's take an example to create a list of <employee> element with its attribute "id" and its child <firstname>, <lastname>, <nickname>, and <salary> by iterating over each employee.

Employee.xml

Employee.xsl

Output:

XSLT Xsl apply template element 1
Next TopicXSLT <import>




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials