haul 01/12/10 01:05:54
Modified: src/org/apache/cocoon/components/language/markup/sitemap/java
sitemap.xsl
Log:
map:call now _always_ creates a new map
Revision Changes Path
1.53 +27 -17
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.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- sitemap.xsl 2001/12/07 16:30:56 1.52
+++ sitemap.xsl 2001/12/10 09:05:54 1.53
@@ -126,7 +126,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.52 2001/12/07 16:30:56 haul Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.53 2001/12/10 09:05:54 haul 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"/>";
@@ -1392,24 +1392,34 @@
<!-- generate the code to redirect a request to an internal resource definition
-->
<xsl:template match="map:call">
- <xsl:if test="map:parameter">
- map = new HashMap(<xsl:value-of select="count(map:parameter)"/>);
- <xsl:for-each select="map:parameter">
- <xsl:variable name="name">
- <xsl:call-template name="get-parameter">
- <xsl:with-param name="parname">name</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="value">
- <xsl:call-template name="get-parameter">
- <xsl:with-param name="parname">value</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- map.put("<xsl:value-of select="$name"/>", substitute(listOfMaps,
"<xsl:value-of select="$value"/>"));
- </xsl:for-each>
+ <xsl:choose>
+
+ <xsl:when test="map:parameter">
+ map = new HashMap(<xsl:value-of select="count(map:parameter)"/>);
+
+ <xsl:for-each select="map:parameter">
+ <xsl:variable name="name">
+ <xsl:call-template name="get-parameter">
+ <xsl:with-param name="parname">name</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="value">
+ <xsl:call-template name="get-parameter">
+ <xsl:with-param name="parname">value</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ map.put("<xsl:value-of select="$name"/>", substitute(listOfMaps,
"<xsl:value-of select="$value"/>"));
+ </xsl:for-each>
+
+ </xsl:when>
+
+ <xsl:otherwise>
+ map = new HashMap(1);
+ </xsl:otherwise>
+
+ </xsl:choose>
listOfMaps.add(map);
this.dumpParameters(listOfMaps);
- </xsl:if>
Class[] argTypes = new Class[] {StreamPipeline.class, EventPipeline.class,
List.class, Environment.class, String.class, Boolean.TYPE};
Object[] argValues = new Object[] {pipeline, eventPipeline, listOfMaps,
environment, cocoon_view, new Boolean(internalRequest)};
String methodName = "resource_" + substitute(listOfMaps, "<xsl:value-of
select="translate(@resource, '- ', '__')"/>");
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]