Using the Core XML tags : XML « JSP « Java

Using the Core XML tags

<%@ taglib uri="" prefix="x" %>
<%@ taglib uri="" prefix="c" %>
<head><title>Using the Core XML tags</title></head>
<h2>Here are the context-params and servlets from the XML file</h2>

<c:import url="http://localhost:8080/home/web.xml" var="webXml" />

<x:parse xml="${webXml}" var="doc" />

<h3>First the context params...</h3>

<x:forEach select="$doc//context-param">

    <x:out select="param-name"/>: <x:out select="param-value"/>


<h3>Now the servlet info...</h3>

<x:forEach select="$doc//servlet>

    <x:out select="servlet-name"/><br />
  <x:out select="servlet-class"/><br /><br />




Related examples in the same category

1.XML transformation
2.Performing XSL Transformations
3.JSP in pure XML generating conforming XHTML
5.XSLT in JSP 2
6.JSP Parsing using the DOM
7.JSP Parsing using JDOM
8.JSP Parsing using the DOM and JSTL
9.JSP and SAX
10.JSP Displaying a Subset in XML
11.JSP XML and XSLT transform
12.JSP List of data in the XML document
13.Deal With XML In JSP