Vadim

I appreciate all the help so far.  The samples are still not working
tho', after
making the changes you suggested...

I have attached the files - they are saved in a derek1/logic subdir
(directly
under cocoon), along with the following additiion in the sitemap.xmap
file:

   <map:match pattern="derek1/logic/greeting3.xml">
    <map:generate type="serverpages" src="derek1/logic/greeting3.xml"
/>
    <map:transform type="xslt" src="derek1/logic/greeting.xsl"/>
    <map:serialize/>
   </map:match>  

This results in a :

java.lang.IllegalAccessError: 
try to access method
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.addLogicsheetToList
(Lorg/apache/cocoon/components/language/markup/AbstractMarkupLanguage$LanguageDescriptor;
Ljava/lang/String;Lorg/apache/cocoon/environment/SourceResolver;
)V from class
org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage$XSPTransformerChainBuilderFilter

Could you please try your side?

Thanks!
Derek


>>> [EMAIL PROTECTED] 03/02/2002 11:53:16 >>>
> From: Derek Hohls [mailto:[EMAIL PROTECTED]] 
> 
> Vadim
> Thanks for clarifications.

Welcome!

> Sample code I was referring to is in the XSP Logicsheet section of
the
> online manual:
> http://xml.apache.org/cocoon/userdocs/xsp/logicsheet.html 
> and especially the section "Using Logicsheets (Taglibs)"
> (as in the various 'greeting' samples that, as I said, do not work
under
> C2- maybe a hangover from C1)

I see... Yes, this is leftovers from C1. Especially this:

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

and this:

processor.xsp.logicsheet.greeting.java 
  = file:///cocoon/logicsheets/logicsheet.greeting.xsl

First is replaced by sitemap entry, <map:generate type="serverpages"
src="..."/>, and second is configured via cocoon.xconf, find XSP
logicsheets section in there.

Otherwise, these samples should work in C2 also.

Regards,
Vadim

> Derek
> 
> 
> D Hohls
> CSIR Environmentek
> PO Box 17001
> Kwa-Zulu Natal
> South Africa
> 4013
> 
> 
> >>> [EMAIL PROTECTED] 02/03/02 19:51 PM >>>
> Derek,
> 
> > From: Derek Hohls [mailto:[EMAIL PROTECTED]] 
> >
> > Vadim
> >
> > Thanks for the sample code - both of these look quite a bit more
> > complicated than the samples in the XSP Logicsheet, but I will
work
> > through them to try and understand both the grammar and logic.
> 
> Ahem... I have not seen the sample code - so no comments on this
one...
> Where it is, btw?
> 
> 
> > Please excuse my ignorance, but I am still unclear as to how these
are
> > actually *used*.  Is there also a simple.xml file that has has
tags
> that
> > 'call' these sheets?
> 
> logicsheet-test.xsp *is* the XSP page which uses hello logicsheet
> (logicsheet.xsl).
> 
> 
> >  Can I use the original example?
> 
> Which one? What file you are talking about?
> 
> 
> > Also, what does
> > the sitemap pipeline be that will enable these files to actually
be
> > processed by Cocoon?
> 
> Sitemap pipeline provided in the sample Cocoon webapp will work for
this
> example, if you place files in the docs/samples/xsp directory.
Pipeline
> is:
> 
>    <map:match pattern="xsp/*">
>     <map:generate type="serverpages"
src="docs/samples/xsp/{1}.xsp"/>
>     <map:transform src="stylesheets/dynamic-page2html.xsl">
>         <map:parameter name="view-source"
> value="docs/samples/xsp/{1}.xsp"/>
>     <!--
>        Run-time configuration is done through these
>        <map:parameter/> elements. Again, let's have a look at the
>        javadocs:
> 
>        "[...] All <map:parameter> declarations will be made
>        available in the XSLT stylesheet as xsl:variables. [...]"
>     -->
>     </map:transform>
>     <map:serialize/>
>    </map:match>
> 
> 
> Vadim
> 
> 
> 
> >
> > Thanks in advance for help
> > Derek
> >
> > D Hohls
> > CSIR Environmentek
> > PO Box 17001
> > Kwa-Zulu Natal
> > South Africa
> > 4013
> >
> >
> > >>> [EMAIL PROTECTED] 02/03/02 00:03 AM >>>
> > 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]>
> >
> >
> >
> >
---------------------------------------------------------------------
> > 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]>
> 
> 
>
---------------------------------------------------------------------
> 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]>
> 
> 
> 
>
---------------------------------------------------------------------
> 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]>



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

<?xml version="1.0"?>

<xsl:stylesheet
  version="1.0"
  xmlns:xsp="http://apache.org/xsp";;
  xmlns:greeting="http://duke.edu/tutorial/greeting";;
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";;
>
  
<xsl:template match="/">
  <xsl:apply-templates/>
</xsl:template>  

<xsl:template match="xsp:page">
 <xsl:copy>
  <xsl:apply-templates select="@*"/>
  <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

<xsl:template match="greeting:hello-world">
  <!-- more complex XSLT is possible here as well -->
  <xsp:logic>
    // this could be arbitrarily complex Java code, JDBC queries, etc.
    String msg = "Hello, world!";
  </xsp:logic>
  <xsp:expr>msg</xsp:expr>
</xsl:template>

<!-- This template simply copies stuff that doesn't match other -->
<!-- templates and applies templates to any children.           -->
<xsl:template match="@*" priority="-1">
 <xsl:copy>
  <xsl:apply-templates select="@*"/>
 </xsl:copy>
</xsl:template>

</xsl:stylesheet>

<?xml version="1.0"?>

<xsp:page 
  xmlns:greeting="http://duke.edu/tutorial/greeting";
  xmlns:xsp="http://apache.org/xsp";
><xsp:logicsheet location="derek1/logic/logicsheet.greeting.xsl"/>

  <greeting>
    <greeting:hello-world/>
  </greeting>

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

<xsl:template match="/">

  <html>
    <head>
      <title>Logicsheet Test</title>
    </head>
    <body>
      <h1>
        <xsl:value-of select="greeting"/>
      </h1>
    </body>
  </html>
  
</xsl:template>

<!--
  <xsl:apply-templates />
</xsl:template>

<xsl:template match="page">
-->

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