cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl
Date Wed, 14 Nov 2001 22:43:44 GMT
giacomo     01/11/14 14:43:44

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
  Log:
  Fixed the label/view concept. according to a recently discussion on the list.
  
  It is possible to:
  
  1. use more that one label-value (label="content,link rdf")
     separated by comma or blank.
  
  2. the aggregate element can have a label attribute which acts
     as on a generator (all part elements are collected)
  
  3. part elements can have a label attribute. In this case only
     those parts are collected which corresponds to the requested view.
  
  Revision  Changes    Path
  1.47      +161 -53   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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- sitemap.xsl	2001/10/22 13:14:06	1.46
  +++ sitemap.xsl	2001/11/14 22:43:43	1.47
  @@ -54,10 +54,10 @@
                   xmlns:saxon="http://icl.com/saxon">
   //file <xsl:value-of select="saxon:system-id()"/>
   //line <xsl:value-of select="saxon:line-number()"/>
  -</xsl:when>
  +      </xsl:when>
         <xsl:otherwise>
   //line numbers not supported with <xsl:value-of select="$xslt-processor"/>
  -</xsl:otherwise>
  +      </xsl:otherwise>
       </xsl:choose>
     </xsl:template>
     <!-- this template wraps the hole content within a single <code> element which
  @@ -91,6 +91,7 @@
       import java.util.Map;
       import java.util.HashMap;
       import java.util.Stack;
  +    import java.util.StringTokenizer;
   
       import org.apache.avalon.framework.component.Component;
       import org.apache.avalon.framework.configuration.Configurable;
  @@ -125,7 +126,7 @@
        *
        * @author &lt;a href="mailto:giacomo@apache.org"&gt;Giacomo Pati&lt;/a&gt;
        * @author &lt;a href="mailto:bloritsch@apache.org"&gt;Berin Loritsch&lt;/a&gt;
  -     * @version CVS $Id: sitemap.xsl,v 1.46 2001/10/22 13:14:06 sylvain Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.47 2001/11/14 22:43:43 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"/>";
  @@ -137,6 +138,8 @@
         /** An empty &lt;code&gt;Parameter&lt;/code&gt; used to pass to the
sitemap components */
         private Parameters emptyParam = new Parameters();
   
  +      /** HashMap relating labels to view names */
  +      private HashMap view_label_map = new HashMap(<xsl:value-of select="count(/map:sitemap/map:views/map:view[@from-label])"/>);
   
         <!-- Generate matchers which implements CodeFactory -->
         <xsl:for-each select="/map:sitemap/map:components/map:matchers/map:matcher">
  @@ -169,7 +172,7 @@
          </xsl:choose>
         </xsl:for-each>
   
  -		<!-- Generate variables for non-factory patterns -->
  +      <!-- Generate variables for non-factory patterns -->
         <xsl:for-each select="/map:sitemap/map:pipelines//map:match">
   
           <!-- get the type of matcher used -->
  @@ -190,8 +193,8 @@
             </xsl:variable>
             // Pattern for "<xsl:value-of select="@pattern"/>" (either String or prepared
pattern)
             private Object <xsl:value-of select="$matcher-name"/>_expr;
  -        </xsl:if>		
  -		</xsl:for-each>
  +        </xsl:if>
  +      </xsl:for-each>
   
         <!-- Generate selectors which implements CodeFactory -->
         <xsl:for-each select="/map:sitemap/map:components/map:selectors/map:selector">
  @@ -261,6 +264,29 @@
           this.sitemapManager.setLogger(getLogger());
           this.sitemapManager.compose(this.manager);
           this.sitemapManager.configure(conf);
  +
  +        <!-- generate a HashMap relating labels to view names -->
  +        <xsl:for-each select="/map:sitemap/map:views/map:view">
  +          <xsl:variable name="view-label-name">
  +            <xsl:choose>
  +              <xsl:when test="(@from-label)">
  +                <xsl:value-of select="@from-label"/>
  +              </xsl:when>
  +              <xsl:when test="(@from-position)">
  +                <xsl:value-of select="@from-position"/>
  +              </xsl:when>
  +              <xsl:otherwise>
  +                <xsl:call-template name="error">
  +                  <xsl:with-param name="message">missing attribute "from-label" or
"from-position" in declaration of view <xsl:value-of select="@name"/></xsl:with-param>
  +                </xsl:call-template>
  +              </xsl:otherwise>
  +            </xsl:choose>
  +          </xsl:variable>
  +          <xsl:if test="@from-label">
  +            view_label_map.put("<xsl:value-of select="$view-label-name"/>", "<xsl:value-of
select="@name"/>");
  +          </xsl:if>
  +        </xsl:for-each>
  +
           try {
             <!-- configure well known components first -->
             load_component (Sitemap.GENERATOR, "!error-notifier!", "org.apache.cocoon.sitemap.ErrorNotifier",
new DefaultConfiguration("", LOCATION), null);
  @@ -386,7 +412,7 @@
         /** Prepare patterns of PreparableMatchers. */
         public void prepareMatchers() throws Exception {
   
  -		<!-- Generate variables for non-factory patterns -->
  +      <!-- Generate variables for non-factory patterns -->
         <xsl:for-each select="/map:sitemap/map:pipelines//map:match">
   
           <!-- get the type of matcher used -->
  @@ -415,9 +441,8 @@
                   this.<xsl:value-of select="$matcher-name"/>_expr = this.preparePattern("<xsl:value-of
select="$matcher-type"/>", "<xsl:value-of select="XSLTFactoryLoader:escapeBraces($factory-loader,
@pattern)"/>");
               </xsl:otherwise>
             </xsl:choose>
  -        </xsl:if>		
  -		</xsl:for-each>
  -
  +        </xsl:if>
  +      </xsl:for-each>
         }
   
         <!-- generate methods for every map:resource element -->
  @@ -466,6 +491,48 @@
           }
         </xsl:for-each>
   
  +      <!-- generate contains_view method to check if a view request is satisfied -->
  +      private String contains_view(String labels, String cocoon_view) {
  +        if (getLogger().isDebugEnabled()) getLogger().debug("contains_view(\"" + labels
+ "\", \"" + cocoon_view + "\")");
  +        StringTokenizer st = new StringTokenizer(labels, " ,", false);
  +        while (st.hasMoreTokens()) {
  +          String token = st.nextToken();
  +          String view = (String)view_label_map.get(token);
  +          if (getLogger().isDebugEnabled()) getLogger().debug("contains_view: examining
token \"" + token + "\" against view \"" + view + "\"");
  +          if (view != null &amp;&amp; view.equals(cocoon_view)) {
  +            if (getLogger().isDebugEnabled()) getLogger().debug("contains_view: view \""
+ view + "\" selected");
  +            return view;
  +          }
  +        }
  +        return null;
  +      }
  +
  +      <!-- generate call_view method to satisfy a view request -->
  +      private boolean call_view(String view_name,
  +                                StreamPipeline pipeline,
  +                                EventPipeline eventPipeline,
  +                                List listOfMaps,
  +                                Environment environment,
  +                                boolean internalRequest)
  +      throws Exception {
  +        if (getLogger().isDebugEnabled()) getLogger().debug("call_view(\"" + view_name
+ "\")");
  +        <xsl:for-each select="/map:sitemap/map:views/map:view[@from-label]">
  +          <xsl:choose>
  +            <xsl:when test="(@from-label)"/>
  +            <xsl:when test="(@from-position)"/>
  +            <xsl:otherwise>
  +              <xsl:call-template name="error">
  +                <xsl:with-param name="message">missing attribute "from-label" or
"from-position" in declaration of view <xsl:value-of select="@name"/></xsl:with-param>
  +              </xsl:call-template>
  +            </xsl:otherwise>
  +          </xsl:choose>
  +          if ("<xsl:value-of select="@name"/>".equals(view_name)) {
  +            return view_<xsl:value-of select="translate(@name, '- ', '__')"/>(pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
  +          }
  +        </xsl:for-each>
  +        return internalRequest;
  +      }
  +
         <!-- generate methods for every map:action-set element -->
         <xsl:for-each select="/map:sitemap/map:action-sets/map:action-set">
           <xsl:call-template name="line-number"/>
  @@ -527,7 +594,7 @@
               pipeline = (StreamPipeline)this.manager.lookup(StreamPipeline.ROLE);
               pipeline.setEventPipeline(eventPipeline);
             } catch (Exception e) {
  -            getLogger().error("processing of resource failed", e);
  +            if (getLogger().isErrorEnabled()) getLogger().error("processing of resource
failed", e);
               throw e;
             }
   
  @@ -547,7 +614,7 @@
          */
         public boolean process(Environment environment, StreamPipeline pipeline, EventPipeline
eventPipeline)
         throws Exception {
  -        getLogger().debug("processing internal sitemap request");
  +        if (getLogger().isDebugEnabled()) getLogger().debug("processing internal sitemap
request");
           // set the correct component manager
           pipeline.compose(this.manager);
           eventPipeline.compose(this.manager);
  @@ -617,7 +684,7 @@
                 <xsl:when test="(./map:handle-errors[not(@type) or (@type='500')])">
                   getLogger().warn("Error, try to process the error page", e);
                   if (internalRequest) {
  -                  getLogger().error("Sitemap", e);
  +                  if (getLogger().isErrorEnabled()) getLogger().error("Sitemap", e);
                     if (true) throw e;
                   }
                   try {
  @@ -629,7 +696,7 @@
                   }
                 </xsl:when>
                 <xsl:otherwise>
  -                getLogger().error("Sitemap", e);
  +                if (getLogger().isErrorEnabled()) getLogger().error("Sitemap", e);
                   if (true) throw e;
                 </xsl:otherwise>
               </xsl:choose>
  @@ -675,7 +742,7 @@
                 eventPipeline.setGenerator ("!error-notifier!", e.getMessage(), emptyParam,
e);
                 <xsl:apply-templates select="./*"/>
               } catch (Exception ex) {
  -              getLogger().error("error notifier barfs", ex);
  +              if (getLogger().isErrorEnabled()) getLogger().error("error notifier barfs",
ex);
                 throw e;
               } finally {
                 if(eventPipeline != null)
  @@ -769,7 +836,8 @@
       <!-- this is the actual code produced -->
       // handling "<xsl:value-of select="@pattern"/>"
           if ((map = <xsl:value-of select="$matcher-name"/>) != null) {
  -          getLogger().debug("Matched <xsl:value-of select="$matcher-type"/><xsl:text>
</xsl:text><xsl:value-of select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, $pattern-value)"/>");
  +          if (getLogger().isDebugEnabled())
  +            getLogger().debug("Matched <xsl:value-of select="$matcher-type"/><xsl:text>
</xsl:text><xsl:value-of select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of
select="XSLTFactoryLoader:escape($factory-loader, $pattern-value)"/>");
             listOfMaps.add (map);
             <xsl:apply-templates/>
             listOfMaps.remove (listOfMaps.size()-1);
  @@ -868,7 +936,8 @@
           String cocoon_action = environment.getAction();
   
           if ((map = <xsl:value-of select="$matcher-name"/>) != null) {
  -          getLogger().debug("Matched <xsl:value-of select="$matcher-type"/> <xsl:value-of
select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of select="XSLTFactoryLoader:escape($factory-loader,
@pattern)"/>");
  +          if (getLogger().isDebugEnabled())
  +            getLogger().debug("Matched <xsl:value-of select="$matcher-type"/> <xsl:value-of
select="$matcher-name2"/><xsl:text> </xsl:text>pattern:<xsl:value-of select="XSLTFactoryLoader:escape($factory-loader,
@pattern)"/>");
             listOfMaps.add (map);
             <xsl:apply-templates/>
             listOfMaps.remove (listOfMaps.size()-1);
  @@ -968,7 +1037,7 @@
           else
         </xsl:if>
         if (<xsl:value-of select="$selector-name"/>) {
  -        getLogger().debug("Select <xsl:value-of select="$selector-type"/>");
  +        if (getLogger().isDebugEnabled()) getLogger().debug("Select <xsl:value-of select="$selector-type"/>");
           <xsl:apply-templates/>
         }
       </xsl:for-each>
  @@ -977,7 +1046,7 @@
       <xsl:for-each select="./map:otherwise">
         <xsl:call-template name="line-number"/>
         else {
  -        getLogger().debug("Select Otherwise");
  +        if (getLogger().isDebugEnabled()) getLogger().debug("Select Otherwise");
         <xsl:apply-templates/>
         }
       </xsl:for-each>
  @@ -1045,7 +1114,7 @@
             if (redirector.hasRedirected()) {
                return true;
             }
  -          getLogger().debug("Action <xsl:value-of select="$action-type"/>");
  +          if (getLogger().isDebugEnabled()) getLogger().debug("Action <xsl:value-of
select="$action-type"/>");
             listOfMaps.add (map);
             <xsl:apply-templates select="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0'
and local-name() != 'parameter']"/>
             listOfMaps.remove(listOfMaps.size()-1);
  @@ -1113,7 +1182,7 @@
       <xsl:choose>
         <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0' and
local-name() != 'parameter']">
           if ((map = <xsl:value-of select="$action-name"/>.act(redirector, environment,
objectModel, substitute(listOfMaps,<xsl:value-of select="$action-source"/>), <xsl:value-of
select="$component-param"/>)) != null) {
  -          getLogger().debug("Action <xsl:value-of select="$action-type"/>");
  +          if (getLogger().isDebugEnabled()) getLogger().debug("Action <xsl:value-of
select="$action-type"/>");
             listOfMaps.add (map);
             <xsl:apply-templates select="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0'
and local-name() != 'parameter']" mode="set"/>
             listOfMaps.remove(listOfMaps.size()-1);
  @@ -1188,7 +1257,7 @@
             if (redirector.hasRedirected()) {
                 return true;
             }
  -          getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
  +          if (getLogger().isDebugEnabled()) getLogger().debug("Action <xsl:value-of
select="translate($action-name,'&quot;',' ')"/>");
             listOfMaps.add (map);
             <xsl:apply-templates select="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0'
and local-name() != 'parameter']"/>
             listOfMaps.remove(listOfMaps.size()-1);
  @@ -1346,7 +1415,7 @@
               </xsl:otherwise>
             </xsl:choose>
           </xsl:variable>
  -        getLogger().debug("Sitemap: session='<xsl:value-of select="$sess"/>', redirecting
to '<xsl:value-of select="@uri"/>'");
  +        if (getLogger().isDebugEnabled()) getLogger().debug("Sitemap: session='<xsl:value-of
select="$sess"/>', redirecting to '<xsl:value-of select="@uri"/>'");
           environment.redirect (<xsl:value-of select="$sess"/>, substitute(listOfMaps,
"<xsl:value-of select="@uri"/>"));
           if (true) return true;
         </xsl:when>
  @@ -1360,33 +1429,56 @@
       </xsl:choose>
     </xsl:template> <!-- match="map:redirect-to" -->
   
  -  <!-- generate the code to match a label definition -->
  -  <xsl:template match="map:label">
  -    <xsl:apply-templates/>
  -    if ("<xsl:value-of select="@name"/>".equals(cocoon_view))
  -      return view_<xsl:value-of select="translate(@name, '- ', '__')"/> (pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
  -  </xsl:template> <!-- match="map:label" -->
  -
     <!-- generate the code to match a aggregate definition -->
     <xsl:template match="map:aggregate">
       <xsl:call-template name="setup-component">
         <xsl:with-param name="default-component">!content-aggregator!</xsl:with-param>
         <xsl:with-param name="method">eventPipeline.setGenerator</xsl:with-param>
  -      <xsl:with-param name="prefix">generator</xsl:with-param>
  +      <xsl:with-param name="prefix">aggregator</xsl:with-param>
       </xsl:call-template>
       <xsl:variable name="ca">contentAggregator_<xsl:value-of select="generate-id(.)"/></xsl:variable>
       ContentAggregator <xsl:value-of select="$ca"/> = (ContentAggregator)eventPipeline.getGenerator();
       <xsl:if test="not (@element)">
         <xsl:call-template name="error">
           <xsl:with-param name="message">
  -          element attribute missing in aggregate element
  +          attribute 'element' missing in aggregate element
           </xsl:with-param>
         </xsl:call-template>
       </xsl:if>
       <xsl:value-of select="$ca"/>.setRootElement("<xsl:value-of select="@element"/>",
"<xsl:value-of select="@ns"/>", "<xsl:value-of select="@prefix"/>");
  -    <xsl:apply-templates select="./map:part">
  -      <xsl:with-param name="ca"><xsl:value-of select="$ca"/></xsl:with-param>
  -    </xsl:apply-templates>
  +
  +    <!-- check if a view was requested which matches one attached to a part element
-->
  +    {
  +      boolean hasMatchingViewRequest = false;
  +      <xsl:for-each select="map:part[@label]">
  +        if (contains_view("<xsl:value-of select="@label"/>", cocoon_view) != null)
{
  +          hasMatchingViewRequest = true;
  +          <xsl:apply-templates select=".">
  +            <xsl:with-param name="ca"><xsl:value-of select="$ca"/></xsl:with-param>
  +          </xsl:apply-templates>
  +        }
  +      </xsl:for-each>
  +
  +      <!-- process all map:parts -->
  +      if (hasMatchingViewRequest) {
  +        <xsl:for-each select="map:part[@label]">
  +          <xsl:call-template name="view-label">
  +            <xsl:with-param name="label"><xsl:value-of select="@label"/></xsl:with-param>
  +          </xsl:call-template>
  +        </xsl:for-each>
  +      } else {
  +        <xsl:apply-templates select="./map:part">
  +          <xsl:with-param name="ca"><xsl:value-of select="$ca"/></xsl:with-param>
  +        </xsl:apply-templates>
  +      }
  +    }
  +
  +    <!-- process attached labels to the map:aggregate element -->
  +    <xsl:if test="(@label)">
  +      <xsl:call-template name="view-label">
  +        <xsl:with-param name="label"><xsl:value-of select="@label"/></xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
     </xsl:template> <!-- match="map:aggregate" -->
   
     <!-- generate the code to match a aggregates part definition -->
  @@ -1535,7 +1627,7 @@
         <xsl:if test="$prefix='serializer'">
           <xsl:for-each select="/map:sitemap/map:views/map:view[@from-position='last']">
             if ("<xsl:value-of select="@name"/>".equals(cocoon_view)) {
  -            getLogger().debug("View <xsl:value-of select="@name"/>");
  +            if (getLogger().isDebugEnabled()) getLogger().debug("View <xsl:value-of
select="@name"/>");
               return view_<xsl:value-of select="translate(@name, '- ', '__')"/> (pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
             }
           </xsl:for-each>
  @@ -1591,13 +1683,13 @@
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
  -    getLogger().debug("Component <xsl:value-of select="$prefix"/>:<xsl:value-of
select="$component-type"/>(<xsl:value-of select="$component-param"/>)");
  +    if (getLogger().isDebugEnabled()) getLogger().debug("Component <xsl:value-of select="$prefix"/>:<xsl:value-of
select="$component-type"/>(<xsl:value-of select="$component-param"/>)");
       <!-- determine the right invokation according to "has a src attribute" and "has
a mime-type attribute" -->
       <xsl:choose>
         <xsl:when test="$component-source='null'">
           <xsl:choose>
             <xsl:when test="$mime-type!=''">
  -            getLogger().debug("Mime-type: <xsl:value-of select="$mime-type"/>");
  +            if (getLogger().isDebugEnabled()) getLogger().debug("Mime-type: <xsl:value-of
select="$mime-type"/>");
               <xsl:value-of select="$method"/> ("<xsl:value-of select="$component-type"/>",
                 null, <xsl:value-of select="$component-param"/>,"<xsl:value-of select="$mime-type"/>"
               );
  @@ -1610,10 +1702,10 @@
           </xsl:choose>
         </xsl:when>
         <xsl:otherwise>
  -        getLogger().debug("Source=<xsl:value-of select="$component-source"/>");
  +        if (getLogger().isDebugEnabled()) getLogger().debug("Source=<xsl:value-of select="$component-source"/>");
           <xsl:choose>
             <xsl:when test="$mime-type!=''">
  -            getLogger().debug("Mime-type: <xsl:value-of select="$mime-type"/>");
  +            if (getLogger().isDebugEnabled()) getLogger().debug("Mime-type: <xsl:value-of
select="$mime-type"/>");
               <xsl:value-of select="$method"/> ("<xsl:value-of select="$component-type"/>",
                   substitute(listOfMaps,"<xsl:value-of select="$component-source"/>"),
                   <xsl:value-of select="$component-param"/>,"<xsl:value-of select="$mime-type"/>");
  @@ -1628,7 +1720,21 @@
       </xsl:choose>
   
       <!-- view/label check -->
  -    <xsl:if test="not(ancestor::map:views) and not(ancestor::map:handle-errors)">
  +    <xsl:if test="not(ancestor::map:views) and not(ancestor::map:handle-errors) and
not(ancestor-or-self::map:aggregate)">
  +      <xsl:if test="$prefix='generator'">
  +        <xsl:for-each select="/map:sitemap/map:views/map:view[@from-position='first']">
  +          if ("<xsl:value-of select="@name"/>".equals(cocoon_view)) {
  +            return view_<xsl:value-of select="translate(@name, '- ', '__')"/> (pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
  +          }
  +        </xsl:for-each>
  +      </xsl:if>
  +
  +      <xsl:if test="(@label)">
  +        <xsl:call-template name="view-label">
  +          <xsl:with-param name="label"><xsl:value-of select="@label"/></xsl:with-param>
  +        </xsl:call-template>
  +      </xsl:if>
  +
         <xsl:variable name="component-label">
           <xsl:if test="$prefix='generator'">
             <xsl:value-of select="/map:sitemap/map:components/map:generators/map:generator[@name=$component-type]/@label"/>
  @@ -1638,20 +1744,22 @@
           </xsl:if>
         </xsl:variable>
         <xsl:if test="$component-label">
  -        <xsl:for-each select="/map:sitemap/map:views/map:view[@from-label=$component-label]">
  -          if ("<xsl:value-of select="@name"/>".equals(cocoon_view)) {
  -            return view_<xsl:value-of select="translate(@name, '- ', '__')"/> (pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
  -          }
  -        </xsl:for-each>
  -      </xsl:if>
  -      <xsl:if test="$prefix='generator'">
  -        <xsl:for-each select="/map:sitemap/map:views/map:view[@from-position='first']">
  -          if ("<xsl:value-of select="@name"/>".equals(cocoon_view)) {
  -            return view_<xsl:value-of select="translate(@name, '- ', '__')"/> (pipeline,
eventPipeline, listOfMaps, environment, internalRequest);
  -          }
  -        </xsl:for-each>
  +        <xsl:call-template name="view-label">
  +          <xsl:with-param name="label"><xsl:value-of select="$component-label"/></xsl:with-param>
  +        </xsl:call-template>
         </xsl:if>
       </xsl:if>
  +  </xsl:template>
  +
  +  <!-- generate the code to match a label definition -->
  +  <xsl:template name="view-label">
  +    <xsl:param name="label"/>
  +    {
  +      String view_name = null;
  +      if ((view_name = contains_view("<xsl:value-of select="$label"/>", cocoon_view))
!= null) {
  +        return call_view(view_name, pipeline, eventPipeline, listOfMaps, environment, internalRequest);
  +      }
  +    }
     </xsl:template>
   
     <!-- replace invalid characters with underscores -->
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message