You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mike Engelhart <me...@earthtrip.com> on 2000/01/21 17:57:50 UTC
XSP & tag library questions
I'm trying to figure out how to create a tag library and am finding I have a
number of questions. (I know Ricardo is hard at work creating documentation
but I can't wait :-))
1) Does the sample code from the XSP documentation page work? This is the
one where the tag namespace is "example" and is used in
"example:time-of-day" sample. I copied both pages of code to files on my
server and neither of them work.
2) Does the template for a tag library require the following templates:?
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
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>
<!-- if necessary for includes -->
</xsp:structure>
<xsl:apply-templates/>
</xsp:page>
</xsl:template>
<!-- tag libary template goes here -->
<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="@*|node()" priority=-1>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
3) if so, what is the purpose of the "get-nested-content" template and when
are you supposed to call it?
Thanks for any insights.