Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL XMl parsing

 
satya srinivas volla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also having problem in parsing data from feed in jsp.I am getting an exception - Content is not allowed in prolog.
My code syntax:

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



<c:import var="docString" url="feeds/home.xml" /> //feeds located in root directory
<x:parse var="docs" doc="${docString}" />

I am running code in Eclipse IDE,APACHE 6.0,JDK I.6

Exception :

root cause
org.xml.sax.SAXParseException: Content is not allowed in prolog.
org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(Unknown Source)
org.apache.jsp.pages.index_jsp._jspx_meth_x_005fparse_005f0(index_jsp.java:117)
org.apache.jsp.pages.index_jsp._jspService(index_jsp.java:63)
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:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Jars used:

Xalan.jar 1.3, xercesImpl.jar 2.7.1 , xml-apis.jar 1.3.02, xsltc.jar 1.1

In web.xml:

<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/x</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
</jsp-config>



please help me in sorting out this.IS THERE ANY COMPATIBILITY PROBLEM thanks in advance

[ October 21, 2008: Message edited by: satya srinivas volla ]
[ October 21, 2008: Message edited by: satya srinivas volla ]
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi satya srinivas volla welcome to Javaranch
Firstly please take a look at this .

Posting same question in different threads wastes useful time of other ranchers and also reduces the number of useful responses.

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What value does "docString" have?
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!