Try attached example. Put under docs/samples/xsp directory in the Cocoon
sample webapp. Let me know if it was helpful for you.

PS: Note that logicsheet was declared right after <xsp:page> element, no
spaces or tags:

<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp";
          xmlns:xsp-request="http://apache.org/xsp/request/2.0";
          xmlns:xsp-hello="http://apache.org/xsp/hello/1.0";
><xsp:logicsheet location="docs/samples/xsp/logicsheet.xsl"/>

Vadim

> -----Original Message-----
> From: Derek Hohls [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 02, 2002 3:43 PM
> To: [EMAIL PROTECTED]
> Cc: Derek Hohls
> Subject: C2 Newbie: XSP Logicsheet in sitemap ?
> 
> As an ex-Cocoon1 user, I am trying to move all my applications across
to
> C2.  I can see that there are a lot of conceptual chnages that I need
to
> understand to make full use of C2's functionality.
> 
> Right now I am trying to see how to use XSP/logic sheets.  I have
tried
> to implement the examples shown in the XSP Logicsheet Guide, in the C2
> documentation, but have got stuck.
> 
> The first point I noticed was that the namespace for XSP was
incorrect;
> its shown as http://www.apache.org/199/XSP/Core and should actually be
> http://apache.org/xsp (maybe someone can update this?)
> 
> The second point that I cannot get correct is how to implement the
> logicsheet in the sitemap.  While this is straightforward for a
one-step
> case (as in greeting2.xml), it is not clear for the for the two-step
> case (greeting3.xml).
> 
> What I have tried is this (and various combinations):
> 
> <map:match pattern="test/greeting3.xml">
>   <map:generate type="serverpages" src="test/greeting3.xml" />
>   <map:transform type="xslt" src="test/logicsheet.greeting.xsl" />
>   <map:transform type="xslt" src="test/greeting.xsl" />
>   <map:serialize />
> </map:match>
> 
> Does anyone know what it should look like ??  (in order to produce the
> 'Hello World' output one gets from the other two examples)
> 
> As a final note, maybe there is someone who can also update the
section
> on "Using Logicsheets (Taglibs)" as the discussion revolves around the
> approach used in Cocoon 1 and is now no longer appropriate.
> 
> Thanks
> Derek
> 
> ---------------------------------------------------------------------
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>

Attachment: logicsheet-test.xsp
Description: Binary data

<?xml version="1.0"?>
<!--
 *****************************************************************************
 * Copyright (C) The Apache Software Foundation. All rights reserved.        *
 * _________________________________________________________________________ *
 * This software is published under the terms of the Apache Software License *
 * version 1.1, a copy of which has been included  with this distribution in *
 * the LICENSE file.                                                         *
 *****************************************************************************
-->

<!--
 * Hello World logicsheet for the Java language
 *
 * @author <a href="mailto:[EMAIL PROTECTED]>Vadim Gritsenko</a>
 * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:11 $
-->

<xsl:stylesheet
  version="1.0"
  xmlns:xsp="http://apache.org/xsp";
  xmlns:xsp-hello="http://apache.org/xsp/hello/1.0";
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:template match="xsp-hello:greeting">
    <xsl:variable name="name">
      <xsl:choose>
        <xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
        <xsl:when test="xsp-hello:name">
          <xsl:call-template name="get-nested-content">
            <xsl:with-param name="content" select="xsp-hello:name"/>
          </xsl:call-template>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>

    <xsl:variable name="value">
      <xsl:choose>
        <xsl:when test="@value">"<xsl:value-of select="@value"/>"</xsl:when>
        <xsl:when test="xsp-hello:value">
          <xsl:call-template name="get-nested-content">
            <xsl:with-param name="content" select="xsp-hello:value"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>"Hello"</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <xsp:content>
    <xsp:expr><xsl:value-of select="$value"/></xsp:expr>, 
    <xsp:expr><xsl:value-of select="$name"/></xsp:expr>!
    </xsp:content>
  </xsl:template>

  <xsl:template name="get-nested-content">
    <xsl:param name="content"/>
    <xsl:choose>
      <xsl:when test="$content/*">
        <xsl:apply-templates select="$content/*"/>
      </xsl:when>
      <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
  <xsl:template match="@*|*|text()|processing-instruction()">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to