You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by ri...@locus.apache.org on 2000/05/08 17:02:06 UTC
cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java request.xsl
ricardo 00/05/08 08:02:06
Modified: src/org/apache/cocoon/processor/xsp/library/java request.xsl
Log:
Added 'default' attribute to 'get-parameter' tag. This optional value will substitute missing request attributes
Revision Changes Path
1.11 +20 -2 xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/request.xsl
Index: request.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/request.xsl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- request.xsl 2000/03/15 01:01:44 1.10
+++ request.xsl 2000/05/08 15:02:05 1.11
@@ -218,6 +218,19 @@
<xsl:call-template name="value-for-name"/>
</xsl:variable>
+ <xsl:variable name="default">
+ <xsl:choose>
+ <xsl:when test="@default">"<xsl:value-of select="@default"/>"</xsl:when>
+ <xsl:when test="default">
+ <xsl:call-template name="get-nested-content">
+ <xsl:with-param name="content" select="default"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>null</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+
<xsl:variable name="as">
<xsl:call-template name="value-for-as">
<xsl:with-param name="default" select="'string'"/>
@@ -229,12 +242,17 @@
<xsl:when test="$as = 'node'">
XSPRequestLibrary.getParameter(
request,
- String.valueOf(<xsl:copy-of select="$name"/>),
+ String.valueOf(<xsl:copy-of select="$name"/>),
+ <xsl:copy-of select="$default"/>,
document
)
</xsl:when>
<xsl:when test="$as = 'string'">
- request.getParameter(String.valueOf(<xsl:copy-of select="$name"/>))
+ XSPRequestLibrary.getParameter(
+ request,
+ String.valueOf(<xsl:copy-of select="$name"/>),
+ <xsl:copy-of select="$default"/>
+ )
</xsl:when>
</xsl:choose>
</xsp:expr>