cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: [C2] [PATCH] sitemap.xsl
Date Mon, 23 Apr 2001 12:11:44 GMT
Martin,
The subject says sitemap.xsl but the patch was for session.xsl :) Applied it anyway...

Thanks,
dims

--- Martin Man <Martin.Man@seznam.cz> wrote:
> Hi,
> 	attached is a patch that protects sitemap taglib to generate NPE when
> invoking <sitemap:get-attribute name="xxx"/> and session does not exist...
> additionaly it adds an attribute default="xxxx" which works as it should...
> 
> sincerly,
> martin man
> -- 
> -------------------------------------------------------------------------------
> "Only dead fish swims with a stream"
> gpg_key_available: http://globales.cz/~mman/martin.man.gpg
> gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223
> > Index: src/org/apache/cocoon/components/language/markup/xsp/java/session.xsl
> ===================================================================
> RCS file:
>
/home/cvspublic/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java/Attic/session.xsl,v
> retrieving revision 1.1.2.4
> diff -c -u -r1.1.2.4 session.xsl
> --- src/org/apache/cocoon/components/language/markup/xsp/java/session.xsl	2001/03/23
19:38:11
> 1.1.2.4
> +++ src/org/apache/cocoon/components/language/markup/xsp/java/session.xsl	2001/04/23
11:24:42
> @@ -72,15 +72,23 @@
>        </xsl:call-template>
>      </xsl:variable>
>  
> +    <xsl:variable name="default">
> +      <xsl:call-template name="value-for-default">
> +      </xsl:call-template>
> +    </xsl:variable>
> +    
>        <xsl:choose>
>          <xsl:when test="$as = 'xml'">
>  	  <xsp:element name="session:attribute">
> -	    <xsp:expr>XSPRequestHelper.getSessionAttribute(objectModel, String.valueOf(<xsl:copy-of
> select="$name"/>))</xsp:expr>
> +	    <xsp:expr>XSPRequestHelper.getSessionAttribute(objectModel,
> +		    String.valueOf(<xsl:copy-of select="$name"/>),
> +		    String.valueOf(<xsl:copy-of select="$default"/>))</xsp:expr>
>  	  </xsp:element>
>          </xsl:when>
>          <xsl:when test="$as = 'object'">
>            <xsp:expr>XSPRequestHelper.getSessionAttribute(objectModel,
> -            String.valueOf(<xsl:copy-of select="$name"/>)
> +            String.valueOf(<xsl:copy-of select="$name"/>),
> +            String.valueOf(<xsl:copy-of select="$default"/>)
>            )</xsp:expr>
>          </xsl:when>
>        </xsl:choose>
> @@ -352,6 +360,13 @@
>      <xsl:choose>
>        <xsl:when test="@as"><xsl:value-of select="@as"/></xsl:when>
>        <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
> +    </xsl:choose>
> +  </xsl:template>
> +
> +  <xsl:template name="value-for-default">
> +    <xsl:choose>
> +      <xsl:when test="@default">"<xsl:value-of select="@default"/>"</xsl:when>
> +      <xsl:otherwise>""</xsl:otherwise>
>      </xsl:choose>
>    </xsl:template>
>  
> 
> > ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message