Use of tag of JSTL

In this section we will learn how to use tag of Xml tag library of Jstl.

Use of <x:param> tag of JSTL


In this section we will learn how to use <x:param> tag of  Xml tag library of Jstl. This tag is used to add parameter to transform tag. When user want to transform more than one xml files then we will use <x:param> tag, to add xml files in transform tag.

In the code given below we have used doc1, doc2, doc3 as xml source files and use param tag to add these files as parameter to transform tag.






Standard Syntax : <%@ taglib prefix="x" uri="" %>

name  It defines name of the transformation parameter.
value  value of the transformation parameter.


<%@ taglib uri="" prefix="c" %> 
<%@ taglib uri="" prefix="x" %> 
<c:set var="doc1">
<description>This is first document.</description>
<x:parse varDom="doc2">
<description>This is second document.</description>
<x:parse varDom="doc3">
<description>This is third document.</description>
<c:set var="xslt">
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
<xsl:param name="doc2"/>
<xsl:param name="doc3"/>

<xsl:template match="/">
<xsl:value-of select="/document/description" /><br />
<xsl:value-of select="$doc2/document/description" /><br />
<xsl:value-of select="$doc3/document/description" /><br />

<head><title>Example of x:param tag of JSTL</title></head>
<x:transform xml="${doc1}" xslt="${xslt}">
<x:param name="doc2" value="${doc2}" />
<x:param name="doc3" value="${doc3}" />

Output :

Download Source Code 

Share on Google+Share on Google+

Use of tag of JSTL

Posted on: August 27, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: Use of tag of JSTL  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image