cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: running xsp from cocoon
Date Wed, 18 May 2005 06:16:28 GMT
Yes - lack of specification of the correct generator type in
the sitemap *will* lead to XML not being generated correctly;
that's the problem with defaults... the system can easily be
appear to be doing something "wrong" when in fact its just
conforming to a default that you have not overwritten....

I suggest you go and have another look at the sitemap
document - there are clearly two main parts to it - the 
<components> section where the generators, transformers, 
serializers et al are specified,  and the <pipelines> where these 
components are used... the key issue here is that in order
for a particular component to be used, the "type" attribute
*must* be known - if you think you will forget it, then do 
*not* assume any default and specify every type explicitly
e.g. for your example below, use:

     <map:match pattern="greeting">
       <map:generate src="greeting.xml" type="file"/>
        <map:transform src="greeting.xsl" type="xslt"/>
       <map:serialize type="xml"/>
      </map:match>

Your sitemap will be a little more verbose, but it will be easy
to spot when the output is not correct because of an incorrect
component type being used.

HTH
Derek

>>> ebillionaire@gmail.com 2005/05/17 03:15:00 PM >>>
OK i found the problem to this.
we need to add type="serverpages" in the sitemap.xmap.
eg :
        <map:match pattern="dbtest">
                <map:generate type="serverpages" src="dbtest.xsp"/>
                <map:serialize type="xml"/>
        </map:match>

will process dbtest.xsp as an xsp page.

hope this helps others stuck with my problem.

On 5/17/05, n. <ebillionaire@gmail.com> wrote:
> anyone??
> 
> On 5/17/05, n. <ebillionaire@gmail.com> wrote:
> > I am trying to run the following sample from the cocoon tutorial but
> > it doesnt seem to be working:
> >
> > greeting.xml
> > <?xml version="1.0"?>
> >
> > <xsp:page xmlns:xsp="http://apache.org/xsp">
> >
> >         <xsp:logic>
> >                 //this could be arbitrarily complex Java code, JDBC
> > queries, etc.
> >                 String msg = "Hello, World!";
> >         </xsp:logic>
> >
> >         <greeting>
> >                 <xsp:expr>msg</xsp:expr>
> >         </greeting>
> >
> > </xsp:page>
> >
> > greeting.xsl
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> >
> > <xsl:template match="/">
> >         <html>
> >                 <body>
> >         hi
> >                         <h1>
> >                                 <xsl:value-of select="greeting"/>
> >                         </h1>
> >                 </body>
> >         </html>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > I am using cocoon 2.1.7 on tomcat 5.8 as a servlet. I created my own
> > sample directory in the "samples" directory. My sitemap.xmap file
> > looks like this:
> > sitemap.xmap:
> > <?xml version="1.0"?>
> >
> > <!-- CVS $Id: sitemap.xmap 30938 2004-07-29 19:08:16Z vgritsenko $ -->
> >
> > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> >
> >   <map:pipelines>
> >
> >     <map:pipeline>
> >
> >       <map:match pattern="greeting">
> >        <map:generate src="greeting.xml"/>
> >        <map:transform src="greeting.xsl"/>
> >       <map:serialize/>
> >       </map:match>
> >
> >       <map:match pattern="request.xml">
> >        <map:generate src="request.xml"/>
> >       <map:serialize/>
> >       </map:match>
> >
> >      </map:pipeline>
> >
> >   </map:pipelines>
> >
> > </map:sitemap>
> >
> > When I run this, I can only see the 'hi' but not the xsl variable.
> > anyone has any ideas what I might be doing wrong?
> >
> > thanks
> >
> > nayeem
> >
> 
> --
> Want to be a Chess Artist? - groups-beta.google.com/group/ChessCombinations/
> Whats it like to dance in London? -
> groups-beta.google.com/group/LondonDanceNetwork/
> 


-- 
Want to be a Chess Artist? - groups-beta.google.com/group/ChessCombinations/
Whats it like to dance in London? -
groups-beta.google.com/group/LondonDanceNetwork/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
For additional commands, e-mail: users-help@cocoon.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message