XSTL value of

To extract the value of a selected node, the <xsl:value-of> element is used in XSLT.

The <xsl:value-of> Element:

The extracted value of an XML element is also added to the output stream of the transformation, by the <xsl:value-of> element.

Example:

Books.xml:




  
    ABC
    Author Name
    2020
    100.00
  

  
    XQuery Book
    Author 1
    Author 2
    2020
    300.00
  



XSLT Code:




 

  

List of Books

Title Price

Output:

Explanation:

In the above example, an XPath expression is present in the select attribute, that works like navigating a file system, where a forward slash (/) selects subdirectories.