cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: <xsp:attribute> for <xsp-request:get-parameter>
Date Fri, 07 Mar 2003 14:50:32 GMT
On 07.Mar.2003 -- 03:07 PM, Maxime.Gheysen@swisscom.com wrote:
> Well... I see the error (code bellow), I have
> (XSPRequestHelper.getParameter(objectModel, null, null,null, null))
> So, that's why I get the error "java.lang.NullPointerException" but that
> doesn't help me much!
> I still haven't found any solution. And I don't see any other way to do
> what I want!

OK, now, let's look at request.xsl:

  <xsl:template match="xsp-request:get-parameter">
    <xsl:variable name="name">
      <xsl:call-template name="value-for-name"/>
    </xsl:variable>
    <!-- ... -->
  </xsl:template>

and

  <xsl:template name="value-for-name">
    <xsl:choose>
      <xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
      <xsl:when test="xsp-request:name">
        <xsl:call-template name="get-nested-content">
          <xsl:with-param name="content" select="xsp-request:name"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>null</xsl:otherwise>
    </xsl:choose>
  </xsl:template>

and

  <xsl:template name="get-nested-content">
    <xsl:param name="content"/>
    <xsl:choose>
      <xsl:when test="$content/xsp:text">"<xsl:value-of select="$content"/>"</xsl:when>
      <xsl:when test="$content/*">
        <xsl:apply-templates select="$content/*"/>
      </xsl:when>
      <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
    </xsl:choose>
  </xsl:template>

>From this, we see
a) request.xsl does *not* use logicsheet-utils.xsl  :-(
b) a dynamic parameter needs to be enclosed in <xsp-request:name/>

Hence

<xsp-request:get-parameter>
   <xsp-request:name>
      <xsp:expr>foo</xsp:expr>
   </xsp-request:name>
</xsp-request:get-parameter>


	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
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