You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/03/17 21:35:40 UTC

cvs commit: cocoon-2.1/src/webapp/samples/stylesheets sort-samples.xsl

cziegeler    2004/03/17 12:35:40

  Modified:    src/webapp/samples sitemap.xmap
  Added:       src/webapp/samples/stylesheets sort-samples.xsl
  Log:
  Sort the block samples - not the best solution but it works
  
  Revision  Changes    Path
  1.21      +2 -1      cocoon-2.1/src/webapp/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/sitemap.xmap,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- sitemap.xmap	10 Mar 2004 15:39:51 -0000	1.20
  +++ sitemap.xmap	17 Mar 2004 20:35:40 -0000	1.21
  @@ -95,6 +95,7 @@
   
      <map:match pattern="blocks">
       <map:generate src="block-samples.xml"/>
  +    <map:transform src="stylesheets/sort-samples.xsl"/>
       <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
       </map:transform>
  
  
  
  1.1                  cocoon-2.1/src/webapp/samples/stylesheets/sort-samples.xsl
  
  Index: sort-samples.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  
  <!--+
      | Sort groups in alphabetical order.
      |
      | CVS $Id: sort-samples.xsl,v 1.1 2004/03/17 20:35:40 cziegeler Exp $
      +-->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="samples">
      <samples>
        <xsl:apply-templates select="group[@name='Back']"/>
        <xsl:for-each select="group[not(@name='Back')]">
          <xsl:sort select="@name"/>
          <xsl:apply-templates select="."/>
        </xsl:for-each>
      </samples>
    </xsl:template>
    <xsl:template match="@*|node()">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
  
    <xsl:template match="text()">
      <xsl:value-of select="."/>
    </xsl:template>
  </xsl:stylesheet>
  
  
  

RE: cvs commit: cocoon-2.1/src/webapp/samples/stylesheets sort-samples.xsl

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Joerg Heinicke [mailto:joerg.heinicke@gmx.de] wrote:
> 
> On 17.03.2004 21:35, cziegeler@apache.org wrote:
> 
> > cziegeler    2004/03/17 12:35:40
> > 
> >   Modified:    src/webapp/samples sitemap.xmap
> >   Added:       src/webapp/samples/stylesheets sort-samples.xsl
> >   Log:
> >   Sort the block samples - not the best solution but it works
> 
> >         <xsl:apply-templates select="group[@name='Back']"/>
> >         <xsl:for-each select="group[not(@name='Back')]">
> 
> This is the "not best solution" part you had in mind I guess. 
> What about removing "Back" as samples group, what it is not, 
> and therefore add this into the "navigation" header?
> 
Yes, sounds good to me.

Carsten


Re: cvs commit: cocoon-2.1/src/webapp/samples/stylesheets sort-samples.xsl

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.03.2004 21:35, cziegeler@apache.org wrote:

> cziegeler    2004/03/17 12:35:40
> 
>   Modified:    src/webapp/samples sitemap.xmap
>   Added:       src/webapp/samples/stylesheets sort-samples.xsl
>   Log:
>   Sort the block samples - not the best solution but it works

>         <xsl:apply-templates select="group[@name='Back']"/>
>         <xsl:for-each select="group[not(@name='Back')]">

This is the "not best solution" part you had in mind I guess. What about 
removing "Back" as samples group, what it is not, and therefore add this 
into the "navigation" header?

Joerg