You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jon Brisbin <br...@ipa.net> on 2001/03/03 17:16:48 UTC

"can't output text before document element" problem solved

Hi all :-)

Thanks to some helpful suggestions, I thought I'd post a note for the
archives that, buried in the cocoon-users archives, is one message that
finally shed some light on what I wasn't doing that gave me the following
error:

org.apache.xalan.xslt.XSLProcessorException: Warning: can't output text
before document element!  Ignoring..

The message is:
http://mailman.real-time.com/pipermail/cocoon-users/2000-August/003105.html

Basically, you also have to copy the the last template from the sample
logicsheets to match all the other elements in your page, and not just the
one you're interested in using...I used this template:

    <xsl:template match="@*|*|text()|processing-instruction()">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
    </xsl:template>

One thing I didn't really get, being somewhat new to XSL, is that your page
is fully processed by the logicsheet and that you have to handle all the
other tags in your page, just like you would for a normal stylesheet...

Jon Brisbin
www.jbrisbin.net


RE: Cacheproblem

Posted by Tony <to...@employer.com.br>.
Ok

Now I've got my pages cached...
I saw a previous post that save me ( Thanks Donald) :)

	public boolean isCacheable (HttpServletRequest request) {
        return true;
      }
was the answer.
Probalby the  <util:cacheable/> template is missing this...


Tony.





> -----Original Message-----
> From: tony [mailto:tony@employer.com.br]
> Sent: segunda-feira, 16 de abril de 2001 11:13
> To: cocoon-users@xml.apache.org
> Subject: Cacheproblem
> 
> 
> 
> Hi all,
> 
> I saw previous XSP cache related problems in the list without 
> proper answers
> and I found myself in the same situation. I read the doc on how 
> to make the
> cache working, but I was unable to get it going.
> 
> Cocoon 1.8.2
> Tomcat 3.2.1
> 
> (I am using Tomcat without apache for the developement.)
> 
> If the cache works, this simple XML example should return the 
> first XSP buid
> time stamp and not change on each refresh as it does. My 
> Cocoon.prperties is
> untouched since installation ( caching ON). What is wrong ?
> 
> Thanks for any suggestions,
> 
> Tony.
> 
> Cocoon.properties
> 
> # the default cache
> cache = org.apache.cocoon.cache.CocoonCache
> #uncomment this to disable ALL page caching
> #cache = org.apache.cocoon.cache.NoCache
> #Change this to false to disable all Last-Modified headers
> #This will also disable client-side and proxy caching, but not Cocoon
> #internal caching.
> #Content that is not cached by Cocoon will not have a 
> Last-Modified header.
> lastmodified = true
> 
> 
> This is my test.xml
> 
> <?xml version="1.0"?>
> <?cocoon-format type="text/html"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet href="manager.xsl" type="text/xsl"?>
> <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:util="http://www.apache.org/1999/XSP/Util">
> 	<xsp:structure>
> 		 <util:cacheable/>
> 	</xsp:structure>
> 	<xsp:logic>
>       public boolean hasChanged (Object context) {
>        return false; // to cache everything and leave
>        // memory management up to Cocoon
> 		}
>        // Define a variable to hold the time of day
>       Date now = new Date();
>     </xsp:logic>
> 	<page>
> 		<content>
> 			<paragraph>
> 			<xsp:logic>
> 					now = new Date();
> 			</xsp:logic>
> 			<xsp:expr>
> 				now
> 			</xsp:expr>
> 		</content>
> 	</page>
> </xsp:page>
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.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/faqs.html>

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


Cacheproblem

Posted by tony <to...@employer.com.br>.
Hi all,

I saw previous XSP cache related problems in the list without proper answers
and I found myself in the same situation. I read the doc on how to make the
cache working, but I was unable to get it going.

Cocoon 1.8.2
Tomcat 3.2.1

(I am using Tomcat without apache for the developement.)

If the cache works, this simple XML example should return the first XSP buid
time stamp and not change on each refresh as it does. My Cocoon.prperties is
untouched since installation ( caching ON). What is wrong ?

Thanks for any suggestions,

Tony.

Cocoon.properties

# the default cache
cache = org.apache.cocoon.cache.CocoonCache
#uncomment this to disable ALL page caching
#cache = org.apache.cocoon.cache.NoCache
#Change this to false to disable all Last-Modified headers
#This will also disable client-side and proxy caching, but not Cocoon
#internal caching.
#Content that is not cached by Cocoon will not have a Last-Modified header.
lastmodified = true


This is my test.xml

<?xml version="1.0"?>
<?cocoon-format type="text/html"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="manager.xsl" type="text/xsl"?>
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:util="http://www.apache.org/1999/XSP/Util">
	<xsp:structure>
		 <util:cacheable/>
	</xsp:structure>
	<xsp:logic>
      public boolean hasChanged (Object context) {
       return false; // to cache everything and leave
       // memory management up to Cocoon
		}
       // Define a variable to hold the time of day
      Date now = new Date();
    </xsp:logic>
	<page>
		<content>
			<paragraph>
			<xsp:logic>
					now = new Date();
			</xsp:logic>
			<xsp:expr>
				now
			</xsp:expr>
		</content>
	</page>
</xsp:page>



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

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