This Function use to escape the characters that interpreted as XML markup Language.

In this Program first we declare the syntax of function library. After then we declare the variable as per condition the other hand the function used in this program will escape the characters that interprets under xml. After declaring the variables we put the function syntax that will use to execute on the web browser. At last we close all the custom or html tags.

fn:escapeXML.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 

<html>

    <head>

           <title>&lt;fn:escapeXML&gt; In JSTL</title>

    </head>

   <body>

         <c:set var="str" value="This is Example of <b>Java Server Pages</b> escapeXML Function In  JSTL."></c:set>

         <center><p><br />Without escapeXml function : ${str}

         <br/>

         <center><p><br />With escapeXml function : ${fn:escapeXml(str)}

   </body>

</html>

       JSTL fn:escapeXml() Function





About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.