You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Piyush Sheth <pi...@imagine-sw.com> on 2000/12/30 00:39:08 UTC
Re: taglib, logichseet - no output ---- ignore it
Silly me. Jeff Please ignore my last mail. It works!!!!!.
Thank You,
I am going to enjoy my new year's eve.
Many Thanks again.
----- Original Message -----
From: <je...@socialchange.net.au>
To: <co...@xml.apache.org>
Sent: Thursday, December 28, 2000 9:38 PM
Subject: Re: taglib, logichseet - no output
>
>
> > here are 3 files
> > simple.xml
> > simplelogic.xsl
> > simpledisplay.xsl
> >
> > I get blank output and I get no error message. I have been trying to
make
> > this work since 2 days but without luck.
>
> Don't wait so long before posting next time ;)
>
> > Could someone please point out what am I missing ? ( yes I did modify to
> > include SimpleClass.class in my classpath
>
> FYI, C1 has a bug where WEB-INF/classes/* classes aren't accessible
> from XSP. (http://marc.theaimsgroup.com/?t=97374220700001&w=2&r=1)
>
> > and cocoon.properties to include namespace - logicsheet mapping ).
>
> You don't need this if you're using <?xml-logicsheet?> PIs.
>
> Corrections inline.
>
> >
> > <?xml version='1.0'?>
> > <?cocoon-process type="xsp"?>
> > <?cocoon-process type="xslt"?>
> > <?xml-logicsheet href="simplelogic.xsl" type="text/xsl"?>
>
> Most people don't declare a 'type' attribute here, but it doesn't
> seem to matter.
>
> > <?xml-stylesheet href="simpledisplay.xsl" type="text/xsl"?>
> >
> > <xsp:page language="java"
> > xmlns:simple="http://ntbo3.imagine-sw.com/2000/XSP/Simple"
> >
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> > <page>
> > <title>
> > My Page
> > </title>
> > <p>Simple Sentence <simple:sayHello/></p>
> > </page>
> > </xsp:page>
> >
> > ______________________________________________
> >
> > simplelogic.xsl
> >
> > <?xml version="1.0"?>
> > <xsl:stylesheet
> > xmlns:simple="http://ntbo3.imagine-sw.com/2000/XSP/Simple"
> > xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
> > xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> >
> >
> > <xsl:template match="xsp:page">
> > <xsp:page>
> > <xsl:copy>
> > <xsl:apply-templates select="@*"/>
> > </xsl:copy>
> > <xsp:structure>
> > <xsp:include>simplePackage.*</xsp:include>
> > </xsp:structure>
> > <xsp:apply-templates/>
> ^^^
> should be <xsl:apply-templates/>. Don't you feel silly now ;)
>
> > </xsp:page>
> > </xsl:template>
> >
> > <xsl:template match="simple:sayHello">
> > <xsp:logic>
> >
> > SimpleClass obj = new SimpleClass( "John" );
> > private String greet()
> > {
> > obj.sayHello();
> > }
>
> Here's another problem.. you can't declare methods anywhere
> except in <xsp:logic> sections directly below <xsp:page>.
> Move your greet() method to a section below <xsp:structure>.
> Also, your method doesn't return anything.
> I'll paste the final thing below.
>
> --Jeff
>
> >
> > </xsp:logic>
> > <xsp:expr>
> > greet()
> > </xsp:expr>
> > </xsl:template>
> > <xsl:template match="@*|node()" priority="-1">
> > <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
> > </xsl:template>
> > </xsl:stylesheet>
> > __________________________________________________________
> >
> > simpledisplay.xsl
> >
> > <?xml version="1.0"?>
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >
> > <xsl:template match="page">
> > <xsl:processing-instruction
> > name="cocoon-format">type="text/html"</xsl:processing-instruction>
> > <html>
> > <head>
> > <title><xsl:apply-templates select="title"/></title>
> > </head>
> > <body>
> > <xsl:copy>
> > <xsl:apply-templates select="p"/>
> > </xsl:copy>
> > </body>
> > </html>
> > </xsl:template>
> > </xsl:stylesheet>
> > _______________________________________________________
>
>
> Corrected simplelogic.xsl
>
> <?xml version="1.0"?>
> <xsl:stylesheet
> xmlns:simple="http://ntbo3.imagine-sw.com/2000/XSP/Simple"
> xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> <xsl:template match="xsp:page">
> <xsp:page>
> <xsl:copy>
> <xsl:apply-templates select="@*" />
> </xsl:copy>
>
> <xsp:structure>
> <xsp:include>simplePackage.*</xsp:include>
> </xsp:structure>
>
> <xsp:logic>private String greet(SimpleClass c) { return
> c.sayHello(); }</xsp:logic>
>
> <xsl:apply-templates />
> </xsp:page>
> </xsl:template>
>
> <xsl:template match="simple:sayHello">
> <xsp:logic>SimpleClass obj = new SimpleClass( "John"
> );</xsp:logic>
>
> <xsp:expr>greet(obj)</xsp:expr>
> </xsl:template>
>
> <xsl:template match="@*|node()" priority="-1">
> <xsl:copy>
> <xsl:apply-templates select="@*|node()" />
> </xsl:copy>
> </xsl:template>
> </xsl:stylesheet>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>