cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lock, Fred" <fl...@gohealthcast.com>
Subject [C2] Trouble with <xsp:include> tags in my taglib
Date Fri, 20 Oct 2000 17:30:00 GMT
I'm having trouble with the <xsp:structure> and <xsp:include> tags under C2.
The trouble is that when I look in the repository at the generated java
class file for my xsp, the required import statement is not included.

It's as if C2 applies xsp.xsl to the xsp page before applying my custom
taglib. I say this because if I put the <xsp:structure> and <xsp:include>
tags in the xsp itself, then cocoon generates the import statement in the
output java class. However, I don't want to do this in the xsp. I don't want
my xsp's to have to know what they need to import.

Any suggestions? The code that does not generate the import statement is
included below.

Fred J. Lock
Lead Developer
HealthCast, LLC
www.gohealthcast.com

//////////////////////////////////////////////////////////
// Here's my xsp:
//////////////////////////////////////////////////////////

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
  language="java"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:message="http://www.altacast.com/xsp/message"
>
  <page>
    <greeting>
      <message:hello/>
    </greeting>
  </page>
</xsp:page>

//////////////////////////////////////////////////////////
// Here's my taglib:
//////////////////////////////////////////////////////////

<?xml version="1.0"?>

<xsl:stylesheet
  version="1.0"
  xmlns:message="http://www.altacast.com/xsp/message"
  xmlns:xsp="http://xml.apache.org/xsp"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

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

      <!-- This should generate an import in the output java class, -->
      <!-- but it doesn't -->
      <xsp:structure>
        <xsp:include>com.altacast.louis.LouisManager</xsp:include>
      </xsp:structure>

      <xsl:copy>
        <xsl:apply-templates select="@*"/>
      </xsl:copy>

      <xsl:apply-templates/>

    </xsp:page>
  </xsl:template>

  <!-- hello -->
  <xsl:template match="message:hello">
    Hello, World!
  </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>


Mime
View raw message