Index: src/org/apache/cocoon/sitemap/AbstractSitemap.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v
retrieving revision 1.7
diff -u -r1.7 AbstractSitemap.java
--- src/org/apache/cocoon/sitemap/AbstractSitemap.java	2001/06/14 16:44:17	1.7
+++ src/org/apache/cocoon/sitemap/AbstractSitemap.java	2001/06/22 13:53:59
@@ -284,13 +284,21 @@
                     k--;
                 }
                 m = s.lastIndexOf('/');
-                if (m == -1) {
-                    result.append(((Object)((Map)list.get(k)).get(s)).toString());
-                } else {
-                    result.append(((Object)((Map)list.get(k)).get(s.substring(m + 1))).toString());
+
+                if (m > -1) {
+                    s  = s.substring(m + 1);
                 }
-                getLogger().debug("substitute evaluated value for " + ((m == -1) ? s : s.substring(m + 1)) + " as " +
-                    ((Object)((Map)list.get(k)).get((m == -1) ? s : s.substring(m + 1))).toString());
+                Object str = ((Map)list.get(k)).get(s);
+                                 
+                if (str == null) {
+                    getLogger().warn("substitute: evaluated value for " + s + " is NULL, I change it to ''!");
+                    str = "";
+                } 
+
+                result.append(str.toString());
+
+                getLogger().debug("substitute evaluated value for " + s + " as '" + str + "'");
+
             }
             if (ii < expr.length()) {
                 result.append(expr.substring(ii));
