You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "n." <eb...@gmail.com> on 2005/05/17 09:33:37 UTC

running xsp from cocoon

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

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


Re: running xsp from cocoon

Posted by Askild Aaberg Olsen <as...@xangeli.com>.
n. wrote:

>anyone??
>
>On 5/17/05, n. <eb...@gmail.com> wrote:
>  
>
>>      <map:match pattern="greeting">
>>       <map:generate src="greeting.xml"/>
>>       <map:transform src="greeting.xsl"/>
>>      <map:serialize/>
>>      </map:match>
>>    
>>
Did you declare "serverpages" as default generator? If not, try adding 
type="serverpages" to the map:generate-statement above.

When debugging pipelines, try to comment out the transformers to see if 
the generator produces the output exptected. If you can read "Hello 
World" in the generators xml, then the xslt is the cause of the problem.

Askild

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


Re: running xsp from cocoon

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
n. wrote:

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

do yourself a favour and use JX / flow. XSP is deprecated.


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


Re: running xsp from cocoon

Posted by "n." <eb...@gmail.com>.
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. <eb...@gmail.com> wrote:
> anyone??
> 
> On 5/17/05, n. <eb...@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


Re: running xsp from cocoon

Posted by "n." <eb...@gmail.com>.
anyone??

On 5/17/05, n. <eb...@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/

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