cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Stimmel <jon-li...@stimmel.net>
Subject Re: question about XSP namespace ordering
Date Mon, 10 Jul 2000 21:06:39 GMT
On Mon, Jul 10, 2000 at 04:43:09PM -0400, Donald Ball wrote:

> <foo:article>
>  <foo:id><request:get-parameter name="id"/></foo:id>
> </foo:article>
> 
> where the foo namespace is processed by the logicsheet PI and the request
> namespace is processed automatically by the request namespace
> declaration. however, this doesn't work as expected since the foo
> namespace is processed before the request namespace.

It shouldn't matter what order they're processed in; the foo logicsheet
needs to copy the request tag to the output document, so that it
will still be available for the request logicsheet to handle. The
built-in logicsheets use a template called "get-nested-content" to
handle this:

  ...
    <xsl:call-template name="get-nested-content">
      <xsl:with-param name="content" select="foo:id"/>
    </xsl:call-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>

Mime
View raw message