Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
JSP
JSTL XML tags
Vinod Awar
Ranch Hand
Posts: 129
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hii all,
iam trying to read xml file using <x:forEach tag>. my
jsp
code is as follows
<%@ page language="java" contentType="text/html"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title></title> </head> <body> <c:import url="books.xml" var="url"/> <x:parse xml="${url}" var="doc"/><br> <x:forEach var="n" select="$doc/books/book"> <x:out select="$n/title"/><br> <x:out select="$n/author"/><br> </x:forEach> </body> </html>
and the xml file iam using looks like
<?xml version="1.0" encoding="UTF-8"?> <books> <book> <title>java</title> <author>kathy</author> </book> <book> <title>servlets</title> <author>Marty Hall</author> </book> <book> <title>SCJP</title> <author>Khalid Mughal</author> </book> </books>
when i try to access this jsp page i am getting this
org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Content is not allowed in prolog. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause
what should i do?
Vinod Awar
Ranch Hand
Posts: 129
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Also the server log shows a
org.xml.sax.SAXParseException: Content is not allowed in prolog
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSTL-XML problem
jstl xml error
JasperException with RSS and JSTL
XML Parsing issue
JSTL XML
More...