You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Konstantin Piroumian <kp...@apache.org> on 2002/09/16 14:22:13 UTC

Re: Automatically generated linefeed before in the JSP causes SAXException

If the JSP samples work then this is probably a problem somewhere in your
XML.
How does your sitemap look like (the relevant part)?

Konstantin

----- Original Message -----
From: Eduardo Zurita
To: cocoon-users@xml.apache.org
Sent: Monday, January 20, 2003 16:05
Subject: Automatically generated linefeed before <?xml ...?> in the JSP
causes SAXException


Hello,

    I have found that my JSP generator always prints a LineFeed
automatically before <?xml.....?> causing the SAXException.

    I have examined the generated source and yes, there is a generated
"out.write("\r\n");" just before my code.

    How can I resolve this?

    Thanks.

    Eduardo.





---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Automatically generated linefeed before in the JSP causes SAXException

Posted by Murad Jura <mu...@asbt.uz>.
Hello Eduardo,

> The qeq.jsp is a program that connects to remote URL using a
> HttpURLConnection object. I do it this way because I need modify some
> request properties. This remote URL returns XML data. The JSP simply writes

You may use the SourceResolver to access to your remote XML.
Another way is to set your favorite request parameters in your action. 
Next you can use they in the sitemap in this way:

<map:act type="your-action">
   <map:generator 
src="http://your/http/resource?param1={param1}&amp;param2={param2}"/>
   ...
</map:act>

Or you can generate your query in your action:

<map:act type="your-action">
   <map:generator src="{query}"/>
   ...
</map:act>

Murad Jura.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Automatically generated linefeed before in the JSP causes SAXException

Posted by Eduardo Zurita <g0...@correo.cajacanarias.es>.
Thanks to all. Problem solved.

There was a linefeed outside the JSP tags.

<%@page.......%>            <------This was the linefeed causing problems.
<% String xxx;
 .....
....
%>

----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <co...@xml.apache.org>
Sent: Tuesday, January 21, 2003 8:20 PM
Subject: Re: Automatically generated linefeed before <?xml ...?> in the JSP
causes SAXException


> Eduardo Zurita wrote:
> > The qeq.jsp is a program that connects to remote URL using a
> > HttpURLConnection object. I do it this way because I need modify some
> > request properties. This remote URL returns XML data. The JSP simply
writes
> > (out.write) the XML to the output. But SAX doesn't like the output.
Always
> > there is a linefeed causing troubles. The linefeed is located just
before
> > any code I have written. The current error says:
>
> The linefeed probably comes from your JSP. Remember that
> everything outside the JSP tags go to the output too.
>
> > ----- Original Message -----
> Could you please get used to snipping those old quotes?
>
> J.Pietschmann
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Automatically generated linefeed before in the JSP causes SAXException

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Eduardo Zurita wrote:
> The qeq.jsp is a program that connects to remote URL using a
> HttpURLConnection object. I do it this way because I need modify some
> request properties. This remote URL returns XML data. The JSP simply writes
> (out.write) the XML to the output. But SAX doesn't like the output. Always
> there is a linefeed causing troubles. The linefeed is located just before
> any code I have written. The current error says:

The linefeed probably comes from your JSP. Remember that
everything outside the JSP tags go to the output too.

> ----- Original Message -----
Could you please get used to snipping those old quotes?

J.Pietschmann



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Automatically generated linefeed before in the JSP causes SAXException

Posted by Eduardo Zurita <g0...@correo.cajacanarias.es>.
Hello again,

The pipeline is:

<map:pipeline>
    <map:match pattern="qeq.html">
      <map:generate type="jsp" src="servicios/qeq/jsp/qeq.jsp"/>
      <map:serialize type="xml"/>
    </map:match>
</map:pipeline>

The qeq.jsp is a program that connects to remote URL using a
HttpURLConnection object. I do it this way because I need modify some
request properties. This remote URL returns XML data. The JSP simply writes
(out.write) the XML to the output. But SAX doesn't like the output. Always
there is a linefeed causing troubles. The linefeed is located just before
any code I have written. The current error says:

org.xml.sax.SAXParseException: The processing instruction target matching
"[xX][mM][lL]" is not allowed.

Please help.

Thanks in advance.

----- Original Message -----
From: "Konstantin Piroumian" <kp...@apache.org>
To: <co...@xml.apache.org>
Sent: Monday, September 16, 2002 12:22 PM
Subject: Re: Automatically generated linefeed before <?xml ...?> in the JSP
causes SAXException


> If the JSP samples work then this is probably a problem somewhere in your
> XML.
> How does your sitemap look like (the relevant part)?
>
> Konstantin
>
> ----- Original Message -----
> From: Eduardo Zurita
> To: cocoon-users@xml.apache.org
> Sent: Monday, January 20, 2003 16:05
> Subject: Automatically generated linefeed before <?xml ...?> in the JSP
> causes SAXException
>
>
> Hello,
>
>     I have found that my JSP generator always prints a LineFeed
> automatically before <?xml.....?> causing the SAXException.
>
>     I have examined the generated source and yes, there is a generated
> "out.write("\r\n");" just before my code.
>
>     How can I resolve this?
>
>     Thanks.
>
>     Eduardo.
>
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>