jstl xml parser not working
i cant seem to be able to select the values from the imported xml file and i dont understand why?
my jsp page:
<%@ page import="java.util.*;" %>
<%@ page contentType="text/html; charset=ISO-8859-5" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>Interactive Experience Database - Template 1</title>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="style.css">
</head>
<body>
<FORM>
<c:import var="xmlfile" url="/cv.xml"/>
<x:parse var="doc" xml="${xmlfile}"/>
<x:out select="$doc/cv/ContactInfo/PersonName"/>
</form>
</body>
</html>
the xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cv>
<cv>
<ContactInfo>
<PersonName>Donald Smith</PersonName>
</ContactInfo>
</cv>
[1403 byte] By [
h1400046a] at [2007-11-26 18:01:25]

# 2
thanks for your reply
i now get a error?
org.apache.jasper.JasperException: An exception occurred processing JSP page /template1.jsp at line 19
16: <x:parse var="doc" xml="${xmlfile}"/>
17:
18:
19: <x:out select="$doc/cv/ContactInfo/PersonName"/>
20:
21: </form>
22: </body>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:555)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:414)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.template1_jsp._jspService(template1_jsp.java:99)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
# 6
> thanks, one thing that annoys me is that that apache
> make it so hard to download anything, finding the
> binary is so time consuming, ive been looking for the
> last half hour. its a joke
I kind of agree with you that for *certain projects* it is a little difficult to find the stable release of the binaries. I personally find it very time consuming to locate the binary for JSTL 1.1 , and finding the binary for Xalan seems a little more easier than finding the one for JSTL 1.1
For Xalan I was quickly able to locate it through google:
Searched for "download apache xalan" , then Google showed me
http://xml.apache.org/xalan-j/downloads.html then I clicked on :
http://www.apache.org/dyn/closer.cgi/xml/xalan-j
~~~~~~~~~~~~~~~~~~~~~~
But for JSTL 1.1 it took quite a number of steps :
Searched on Google for : "download JSTL 1.1"
First link showed:
http://java.sun.com/products/jsp/jstl/downloads/index.html
Shows the link for Standard 1.0 instead of Standard 1.1
(A newbie to JSTL wouldn't know that there's a 1.1 final release download available)
another link for the same keywords takes me to:
http://jakarta.apache.org/taglibs/
Then I click on downloads: http://jakarta.apache.org/taglibs/#Downloads
but it only shows *Nightly Builds* downloads not the stable release ones.
Then I click on JSTL1.1 on the left nav takes me to
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
The download link finally takes me to:
http://people.apache.org/builds/jakarta-taglibs/nightly/
which is again nightly
Then I *carefully* read and finally see:
Download the Binary Distribution of the Final Release:
http://jakarta.apache.org/site/downloads/index.html
Then I click on TagLibs
http://jakarta.apache.org/site/downloads/downloads_taglibs.html
and pick Standard 1.1 Tag lib (assuming that is JSTL 1.1)
http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi
I guess I could report this issue to Apache Taglibs and have them make it more efficient to locate the download for the Taglibs.