cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Forge <fo...@bak.prolan.nl>
Subject Re: XSP tag-library simple problem ;)
Date Tue, 10 Apr 2001 13:14:34 GMT
y

On Tue, 10 Apr 2001, Oskar Werewka wrote:

> 
> When I want to insert class level declaration like (see below in bold).
> The result is that the definition of getMyDate() is not found, when I look 
> in the
> generated Java code i see that neither xsp:structure or xsp:logic
> didn't take effect in the result code, but the <helpdesk:date/> tag
> is expanded correctly.
> 
> Why?
> 
> Thank you for help !
> 
> <?xml version="1.0"?>
> 
> <xsl:stylesheet
>          version="1.0"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>          xmlns:xsp="http://www.apache.org/1999/Core"
>          xmlns:helpdesk="http://www.helpdesk.de"
>  >
> 
>    <xsl:template match="xsp:page">
>      <xsp:page>
>        <xsl:copy>
>          <xsl:apply-templates select="@*"/>
>        </xsl:copy>
>

remove the xsl:copy tags..

 
>        <xsp:structure>
>          <xsp:include>java.util.Date</xsp:include>
>          <xsp:include>java.text.SimpleDateFormat</xsp:include>
>        </xsp:structure>
> 
>        <xsp:logic>
>                  private static String getMyDate()
>                  {
>                          return (new 
> SimpleDateFormat("MM/dd/yyyy")).format(new Date());
>                  }
>        </xsp:logic>
> 
>        <xsl:apply-templates/>
>      </xsp:page>
>    </xsl:template>


insert this here:


<xsl:template
match="xsp:page/*[not(namespace-uri(.)=$xsp-namespace-uri)]">
 <xsl:copy>
  <xsl:apply-templates select="@*"/>
  <xsp:logic>

   /** hmm... **/

  </xsp:logic>
  <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>

This should help.. 

I don't know if you're coding for c1 or c2, but i suggest you copy the
util.xsp or some other working xsp example page and remove what you don't
need..


>     <xsl:template match="helpdesk:date">
>          Date: <xsp:expr>getMyDate()</xsp:expr>
>    </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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message