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
Win a copy of
DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games
this week in the
Agile and Other Processes
forum!
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
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
JSP
JSTL XML tags
Vinod Awar
Ranch Hand
Posts: 129
posted 17 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 17 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
Your mother was a hamster and your father was a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
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...