giacomo 01/05/25 12:00:50
Modified: src/org/apache/cocoon/components/language/markup/sitemap/java
sitemap.xsl
Log:
Corrected the fact that if all actions in an action set fail,
an empty HashMap is returned, not null. To have the same behavior
as standalone actions, a set should return null if all actions in
an action-set return null
Suggested by: Peter Royal <[EMAIL PROTECTED]>
Revision Changes Path
1.10 +14 -4
xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- sitemap.xsl 2001/05/23 15:01:55 1.9
+++ sitemap.xsl 2001/05/25 19:00:47 1.10
@@ -99,7 +99,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo
Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin
Loritsch</a>
- * @version CVS $Id: sitemap.xsl,v 1.9 2001/05/23 15:01:55 giacomo Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.10 2001/05/25 19:00:47 giacomo Exp $
*/
public class <xsl:value-of select="@file-name"/> extends AbstractSitemap
{
static final String LOCATION = "<xsl:value-of
select="translate(@file-path, '/', '.')"/>.<xsl:value-of select="@file-name"/>";
@@ -330,7 +330,7 @@
private Map action_set_<xsl:value-of select="translate(@name, '- ',
'__')"/> (String cocoon_action, List listOfMaps, Environment environment, Map
objectModel, String src, Parameters param)
throws Exception {
Map map;
- Map allMap = new HashMap();
+ Map allMap = null;
Parameters nparam = null;
<xsl:for-each select="map:act">
map = null;
@@ -338,12 +338,22 @@
<xsl:when test="@action">
if ("<xsl:value-of
select="@action"/>".equals(cocoon_action)) {
<xsl:apply-templates select="." mode="set"/>
- if (map != null) allMap.putAll (map);
+ if (map != null) {
+ if (allMap == null) {
+ allMap = new HashMap();
+ }
+ allMap.putAll (map);
+ }
}
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="set"/>
- if (map != null) allMap.putAll (map);
+ if (map != null) {
+ if (allMap == null) {
+ allMap = new HashMap();
+ }
+ allMap.putAll (map);
+ }
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]