2 Replies Latest reply on Feb 13, 2006 4:50 AM by Ashwin

    displaying XML in poerlet jsp

    Ashwin Newbie

      I want to display a formatted-XML string in portlet-jsp page. its goiving an exception:

      13:35:12,546 INFO [STDOUT] [Fatal Error] jstl::1:1: Content is not allowed in prolog.
      13:35:12,546 ERROR [CommandFilter] Exception in command invocation
      javax.servlet.ServletException: javax.servlet.jsp.JspException: Content is not allowed in prolog.

      the code i wrote is :

      <%@ page language="java" import="javax.portlet.*,java.util.*;" contentType="text/html; charset=ISO-8859-1"
      <%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
      <portlet:defineObjects />
      <c:set var="someXML">
       <address2>Banjara Hills</address2>
       <x:parse doc="${someXML}" var="test"/>
       <x:forEach select="$test/record">
       <x:out select="name" /><br>
       <x:out select="phone" /><br>
       <x:out select="website" /><br>
       <x:out select="address1" /><br>
       <x:out select="fax" /><br>

      The same code works in stand-alone jsp.

      Thanks ,