You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeremy Aston <je...@yahoo.co.uk> on 2001/09/21 16:53:41 UTC

More C2 Idiots Guide Requests

Apologies for being so dim, but...

Further to my post on basic C2 XML/XSL deployment I have sucessfully got
XML/XSL transformations going.  I am now trying to do a simple XSP/XSL
transformation and hitting problems.

The XSP page is (code.xsp):

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<xsp:page
	language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
<page>
	<title>Code Page</title>
	<p>This page has some code in it...</p>
	<p>
	  <xsp:logic>
          String msg = "Usual Hello type stuff...";
	  </xsp:logic>
	  <xsp:expr>msg</xsp:expr>
	</p>
	<p>The code should appear above</p>
</page>
</xsp:page>

The XSL file is (code2.xsl):

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="page">
  <html>
    <body>
      <h1>
        <xsl:value-of select="title"/>
      </h1>
			<xsl:apply-templates/>
    </body>
  </html>
</xsl:template>

<xsl:template match="p">
	<xsl:copy>
		<xsl:apply-templates/>
	</xsl:copy>
</xsl:template>

<xsl:template match="@*|node()" priority="-1">
 <xsl:copy>
  <xsl:apply-templates select="@*|node()"/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

and my map match in sitemap.xmap is:

   <map:match pattern="jez/*.xsp">
     <map:generate type="serverpages" src="jez/{1}.xsp"/>
     <map:transform type="xslt" src="jez/{1}.xsl"/>
     <map:serialize/>
   </map:match>

The XSP and XSL files are in {TOMCAT_HOME}/webapps/cocoon/jez

I get the following error when attempting to get
http://localhost:8080/cocoon/jez/code2.xsp

org.apache.cocoon.ProcessingException: Language
Exception:org.apache.cocoon.components.language.LanguageException: Could not
load class for program 'org\apache\cocoon\www\jez\code2_xsp' due to a
java.lang.ClassNotFoundException: org.apache.cocoon.www.jez.code2_xsp

What is interesting is the insertion of the \www in the above path.  Clearly
something is not being compiled or being compiled into the wrong place - I'm
just not sure why or how to fix it.  I am using map code that seems to work
elsewhere in the map file.  FYI the map match code above is in the final
pipeline of the root sitemap.  This is the pipeline that handles things like
the sample apps etc.

Assuming this problem gets sorted I shall next be trying a logicsheet.
Assuming I put a setting into cocoon.xconf are there any other map changes
that have to be done to enforce the inclusion of the logicsheet xsl?  I
can't see an example in the sample stuff that gets sent out.

As a final point - it's C2b2 on Win 2000 Pro, with Apache 1.3.19 and Tomcat
3.2.3.

Many thanks in advance - I'm really getting lots of material for my idiots
guide which I shall put up somewhere very soon!

Jeremy




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
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>


Re: More C2 Idiots Guide Requests

Posted by Arno Illmann <ar...@gmx.de>.
hi jeremy, look at thread "stuck with sitemap.xmap" two threads ago.

;) , Arno

---------------------------------------------------------------------
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>


Re: More C2 Idiots Guide Requests

Posted by Arno Illmann <ar...@gmx.de>.
Hi Jeremy, I am another c2 idiot .. o no I am an very early alpha 0.1 Version of an c2 idiot and I am looking forward to your postings of an C2 Idiot Guide. 

But this of your code snippet 

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

is Cocoon 1, you now do no processing instructions in the corresponding files, you match all in the sitemap - and you are yousing c2 as you wrote. 
OK, I can send you a pdf (good to print and read) made from the doc on the cocoon2 site one month ago or so, and enough for a first overview.

Or I can post it somewhere in teh Web. Let's hear from another later, Arno

---------------------------------------------------------------------
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>