You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Donald Ball <ba...@webslingerZ.com> on 2000/07/10 22:43:09 UTC

question about XSP namespace ordering

Heya. I'm doing something like this in my XSP page:

<?cocoon-process type="xsp"?>
<?xml-logicsheet href="/foo.xsl"?>

<xsp:page
 xmlns:xsp="http://www.apache.org/1999/XSP/Core"
 xmlns:request="http://www.apache.org/1999/XSP/Request"
 xmlns:foo="http://www.example.com/foo"
 language="java"
>

<page>

<foo:article>
 <foo:id><request:get-parameter name="id"/></foo:id>
</foo:article>

</page>

</xsp:page>

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. is there any way,
other than manually inserting a logicsheet PI for the request stylesheet
(ick) to make this work? e.g. any other way to order the logicsheets?

- donald


Re: question about XSP namespace ordering

Posted by Jonathan Stimmel <jo...@stimmel.net>.
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>

Re: question about XSP namespace ordering

Posted by Uli Mayring <ul...@denic.de>.
On Mon, 10 Jul 2000, Donald Ball wrote:

> is there any way,
> other than manually inserting a logicsheet PI for the request stylesheet
> (ick) to make this work? e.g. any other way to order the logicsheets?

Well, as I've written in another mail about SQL processor vs. SQL taglib,
here's a good example of an advantage a processor has over taglibs.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Softwareentwicklung