You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2003/12/17 08:05:18 UTC

cvs commit: cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms sitemap2descr01.xsl sitemapdescr2html.xsl sitemaplinks.xsl sitemaplist2index.xsl

crossley    2003/12/16 23:05:18

  Modified:    src/blocks/scratchpad/samples/sitemap-viewer sitemap.xmap
                        unsecure.xmap
               src/blocks/scratchpad/samples/sitemap-viewer/html intro.xml
               src/blocks/scratchpad/samples/sitemap-viewer/transforms
                        sitemap2descr01.xsl sitemapdescr2html.xsl
                        sitemaplinks.xsl sitemaplist2index.xsl
  Log:
  * Previously used *.xmap to view the sitemaps, but the sitemap in the samples
  directory would claim that pipeline. So now use *._xmap
  * Changed the way to locate the sitemaps. Before, it would take the path
  (like http://.../sitemap-viewer/betwixt/sitemap.xmap). Now use parameters to
  specify location (http://.../sitemap-viewer/sitemap._xmap?location=betwixt).
  This is much easier and more logical.
  * Changed the way the security is set. Only one place in the sitemap is enough
  (by making a pipeline internal or public).
  Submitted by: Jelle Alten jelle<AT>ordina.nl
  PR: 25433
  
  Revision  Changes    Path
  1.3       +79 -97    cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/sitemap.xmap,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap.xmap	12 Dec 2003 04:48:50 -0000	1.2
  +++ sitemap.xmap	17 Dec 2003 07:05:18 -0000	1.3
  @@ -42,6 +42,36 @@
   <!-- =========================== Resources =============================== -->
   <map:resources>
     
  +      <map:resource name="show-sitemap">
  +
  +            <map:aggregate element="sitemapandfiles">
  +                <map:part src="cocoon:/{filename}.descr?location={location}"/>
  +                <map:part src="cocoon:/allfiles-list?location={location}"/>
  +            </map:aggregate>
  +            
  +            <map:transform src="transforms/sitemapdescr2html.xsl">
  +
  +                <!-- set showsources to 0 if you don't want the link to the sources (secure) or to 1 
  +                       if you want to show the sources (unsecure) -->
  +                <map:parameter name="showsources" value="{showsources}"/>
  +            </map:transform>
  +            
  +            <map:select type="browser">
  +                <map:when test="explorer">
  +                </map:when>
  +                <map:when test="mozilla5">
  +                </map:when>
  +                <map:otherwise>
  +                    <map:transform src="transforms/kill-dynamic.xsl"/>
  +                </map:otherwise>
  +            </map:select>
  +
  +            <map:serialize type="xhtml-transitional"/>
  +
  +
  +      </map:resource>
  + 
  +  
     <!-- load a page of a section if page is not available load default page/image 
       of this section
     -->
  @@ -78,92 +108,81 @@
   
   
           <!-- 
  -            If you set the internal-only value to "yes", you'll get the unsecure version of the viewer, 
  -            set it to "no" to make it secure. Also change the "showsources" value in the xsl below from 1 to 0 or 
  -            vice versa -->
  +            If you set the internal-only value to "no", you'll get the unsecure version of the viewer, 
  +            set it to "yes" to make it secure. -->
               
           <map:pipeline internal-only="yes" label="srcviewing">
  +        
               <map:match pattern="src/**">
                   <map:mount uri-prefix="src" check-reload="no" src="unsecure.xmap"/>
               </map:match>
  -            <map:match pattern="**/src/*.xmap">
  +
  +            <map:match pattern="*._xmap">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  -                    <map:redirect-to uri="../../src/{../2}.xmap?location={location}"/>
  -                 </map:act>
  -            </map:match>
  -
  -
  -            <map:match pattern="**/src/**/*.*">
  -                <map:redirect-to uri="../../src/{3}.{4}?location={1}/{2}"/>
  +                    <map:call resource="show-sitemap">
  +                         <map:parameter name="filename" value="{../1}"/>
  +                         <map:parameter name="location" value="{location}"/>
  +                         <map:parameter name="showsources" value="1"/>
  +                    </map:call>
  +                </map:act>
               </map:match>
  +                        
  +        </map:pipeline>
  +            
   
  -            <map:match pattern="**/src/*.*">
  +        <map:pipeline internal-only="no">
  +        
  +            <map:match pattern="*._xmap">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  -                    <map:redirect-to uri="../../src/{../2}.{../3}?location={location}"/>
  -                 </map:act>
  -            </map:match>
  -
  -            <map:match pattern="**/src/**">
  -                <map:read src="cocoon:/../{2}/src/{1}/{3}"/>
  -            </map:match>
  -
  -            <map:match pattern="**/src/*.*">
  -                <map:redirect-to uri="../  "/>
  -            </map:match>
  -
  -            <map:match pattern="*/*/src/*.*">
  -                <map:redirect-to uri="../  "/>
  -            </map:match>
  -
  -            <map:match pattern="**/*/src/*.*">
  -                <map:redirect-to uri="../../  "/>
  -            </map:match>
  -
  -            <map:match pattern="**/*.descr01">
  -                 <map:generate src="cocoon:/source/{1}/{2}.xmap"/>
  -                 <map:transform src="transforms/sitemap2descr01.xsl">
  -                     <map:parameter name="location" value="{1}"/>
  -                 </map:transform>
  -
  -                 <map:serialize type="xml"/>
  +                    <map:call resource="show-sitemap">
  +                         <map:parameter name="filename" value="{../1}"/>
  +                         <map:parameter name="location" value="{location}"/>
  +                         <map:parameter name="showsources" value="0"/>
  +                    </map:call>
  +                </map:act>
               </map:match>
   
  +        </map:pipeline>
  +            
  +        <map:pipeline internal-only="yes">
  +            
               <map:match pattern="*.descr01">
  -                 <map:generate src="cocoon:/source/{1}.xmap"/>
  -                 <map:transform src="transforms/sitemap2descr01.xsl">
  -                     <map:parameter name="location" value=""/>
  -                 </map:transform>
  -
  -                 <map:serialize type="xml"/>
  -            </map:match>
  -
  -            <map:match pattern="**.descr">
  -                 <map:generate src="cocoon:/{1}.descr01"/>
  -                 <map:transform src="transforms/sitemap2descr02.xsl"/>
  -                 <map:serialize type="xml"/>
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                     <map:generate src="../{location}/{../1}.xmap"/>
  +                     <map:transform src="transforms/sitemap2descr01.xsl">
  +                         <map:parameter name="location" value="{location}"/>
  +                         <map:parameter name="filename" value="{../1}.xmap"/>
  +                     </map:transform>
  +                     <map:serialize type="xml"/>
  +                 </map:act>
               </map:match>
   
  -            <map:match pattern="source/**.xmap">
  -                 <map:generate src="../{1}.xmap"/>
  -                 <map:serialize type="xml"/>
  +            <map:match pattern="*.descr">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                     <map:generate src="cocoon:/{../1}.descr01?location={location}"/>
  +                     <map:transform src="transforms/sitemap2descr02.xsl"/>
  +                     <map:serialize type="xml"/>
  +                 </map:act>
               </map:match>
   
           </map:pipeline>
   
   
           <map:pipeline>
  -            <map:match pattern="src/**.xmap">
  +            <map:match pattern="src/**._xmap">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
                       <map:redirect-to uri="../disabled.html"/>
                    </map:act>
               </map:match>
  -            <map:match pattern="**/src/**.xmap">
  +            <map:match pattern="**/src/**._xmap">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  -                    <map:redirect-to uri="../../src/{../2}.xmap?location={location}"/>
  +                    <map:redirect-to uri="../../src/{../2}._xmap?location={location}"/>
                    </map:act>
               </map:match>
           </map:pipeline>
  @@ -171,7 +190,7 @@
   
           <map:pipeline internal-only="yes">
               
  -
  +            
           </map:pipeline>
   
           <map:pipeline internal-only="yes">
  @@ -192,11 +211,7 @@
   
           <map:pipeline>
       
  -            <map:match pattern="**/*.gif">
  -                <map:read mime-type="image/gif" src="cocoon:/{2}.gif"/>
  -            </map:match>
  -
  -            <map:match pattern="*_*.gif">
  +           <map:match pattern="*_*.gif">
                 <map:act type="resource-exists" src="images/{1}_{2}.gif">
                   <map:call resource="load-page">
                     <map:parameter name="sect" value="images"/>
  @@ -221,18 +236,10 @@
               </map:match>
   
   
  -            <map:match pattern="**/*.js">
  -                <map:read mime-type="text/txt" src="scripts/{2}.javascript"/>
  -            </map:match>
  -
               <map:match pattern="*.js">
                   <map:read mime-type="text/txt" src="scripts/{1}.javascript"/>
               </map:match>
   
  -            <map:match pattern="**/*.css">
  -                <map:read mime-type="text/css" src="styles/{2}.css"/>
  -            </map:match>
  -
               <map:match pattern="*.css">
                   <map:read mime-type="text/css" src="styles/{1}.css"/>
               </map:match>
  @@ -286,37 +293,12 @@
                     <map:serialize type="xml"/>
                 </map:match>
   
  -            <map:match pattern="**/*.xmap">
  -            
  -                <map:aggregate element="sitemapandfiles">
  -                    <map:part src="cocoon:/{1}/{2}.descr"/>
  -                    <map:part src="cocoon:/allfiles-list?location={1}"/>
  -                </map:aggregate>
  -                <map:transform src="transforms/sitemapdescr2html.xsl">
  -
  -                    <!-- change showsources to 0 if you don't want the link to the sources -->
  -                    <map:parameter name="showsources" value="0"/>
  -                </map:transform>
  -                
  -                <map:select type="browser">
  -                    <map:when test="explorer">
  -                    </map:when>
  -                    <map:when test="mozilla5">
  -                    </map:when>
  -                    <map:otherwise>
  -                        <map:transform src="transforms/kill-dynamic.xsl"/>
  -                    </map:otherwise>
  -                </map:select>
  -
  -                <map:serialize type="xhtml-transitional"/>
  -            </map:match>
  -
           <map:pipeline>
   
           </map:pipeline>
   
               <map:match pattern="**">
  -                <map:generate  src="cocoon:/{1}.xmap"/>
  +                <map:generate  src="cocoon:/{1}._xmap"/>
                   <map:serialize type="html"/>
               </map:match>
   
  
  
  
  1.2       +63 -44    cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/unsecure.xmap
  
  Index: unsecure.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/unsecure.xmap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- unsecure.xmap	12 Dec 2003 04:48:50 -0000	1.1
  +++ unsecure.xmap	17 Dec 2003 07:05:18 -0000	1.2
  @@ -10,7 +10,11 @@
     <map:generators   default="file"/>
     <map:transformers default="xslt"/>
     <map:readers      default="resource"/>
  -  <map:serializers  default="html"/>
  +  <map:serializers  default="html">
  +          <map:serializer logger="sitemap.serializer.svg2png" mime-type="image/jpeg" name="svg2jpeg" src="org.apache.cocoon.serialization.SVGSerializer">
  +            <parameter name="quality" type="float" value="0.9"/>
  +        </map:serializer>
  +</map:serializers>
     <map:matchers     default="wildcard"/>
     <map:selectors    default="browser">
       <map:selector name="resource-exists"
  @@ -51,7 +55,12 @@
           <map:read src="{src}" mime-type="{mime-type}"/>
       </map:resource>
       
  -  
  +
  +    <map:resource name="svg-view">
  +            <map:generate src="{src}"/>
  +            <map:serialize type="svg2jpeg"/>
  +    </map:resource>
  +      
   </map:resources>
   
       <map:views>
  @@ -66,23 +75,7 @@
   
           <map:pipeline>
       
  -            <map:match pattern="**.descr01">
  -                 <map:generate src="cocoon:/{1}/sitemap.xmap"/>
  -                 <map:transform src="transforms/sitemap2descr01.xsl">
  -                     <map:parameter name="location" value="{1}"/>
  -                 </map:transform>
  -
  -                 <map:serialize type="xml"/>
  -            </map:match>
  -
  -            <map:match pattern="**.descr">
  -                 <map:generate src="cocoon:/{1}.descr01"/>
  -                 <map:transform src="transforms/sitemap2descr02.xsl"/>
  -                 <map:serialize type="xml"/>
  -            </map:match>
  -
  -
  -            <map:match pattern="*.xmap">
  +            <map:match pattern="*._xmap">
                   <map:act type="request">
                        <map:parameter name="parameters" value="true"/>
                       <map:call resource="xml-view">
  @@ -91,28 +84,6 @@
                    </map:act>
               </map:match>
   
  -            <map:match pattern="descr">
  -                <map:act type="request">
  -                     <map:parameter name="parameters" value="true"/>
  -                     <map:generate src="cocoon:/../{location}.descr"/>
  -                     <map:serialize type="xml"/>
  -                 </map:act>
  -            </map:match>
  -
  -
  -            <map:match pattern="**/descr">
  -                <map:act type="request">
  -                    <map:parameter name="parameters" value="true"/>
  -                    <map:redirect-to uri="../descr?location={location}"/>
  -                 </map:act>
  -            </map:match>
  -            
  -            <map:match pattern="**.xmap">
  -                 <map:generate src="../{1}/sitemap.xmap"/>
  -                 <map:serialize type="xml"/>
  -            </map:match>
  -
  -
           </map:pipeline>
           
           <map:pipeline>
  @@ -126,6 +97,14 @@
                   </map:act>
               </map:match>
               
  +            <map:match pattern="*.xsp">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:call resource="xml-view">
  +                        <map:parameter name="src" value="../{location}/{../1}.xsp"/>
  +                    </map:call>
  +                </map:act>
  +            </map:match>
               <map:match pattern="*.xsl">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  @@ -134,6 +113,14 @@
                       </map:call>
                   </map:act>
               </map:match>
  +            <map:match pattern="*.xslt">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:call resource="xml-view">
  +                        <map:parameter name="src" value="../{location}/{../1}.xslt"/>
  +                    </map:call>
  +                </map:act>
  +            </map:match>
               <map:match pattern="*.xhtml">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  @@ -158,6 +145,14 @@
                       </map:call>
                   </map:act>
               </map:match>
  +            <map:match pattern="*.svg">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:call resource="svg-view">
  +                        <map:parameter name="src" value="../{location}/{../1}.svg"/>
  +                    </map:call>
  +                </map:act>
  +            </map:match>
               <map:match pattern="*.gif">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  @@ -213,6 +208,27 @@
                   </map:act>
               </map:match>
   
  +            <map:match pattern="*.txt">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:call resource="text-view">
  +                        <map:parameter name="src" value="../{location}/{../1}.txt"/>
  +                        <map:parameter name="mime-type" value="text/txt" />
  +                    </map:call>
  +                </map:act>
  +            </map:match>
  +
  +            <map:match pattern="*.xlex">
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:call resource="text-view">
  +                        <map:parameter name="src" value="../{location}/{../1}.xlex"/>
  +                        <map:parameter name="mime-type" value="text/txt" />
  +                    </map:call>
  +                </map:act>
  +            </map:match>
  +
  +<!--
               <map:match pattern="**/*.xmap">
                   <map:act type="request">
                       <map:parameter name="parameters" value="true"/>
  @@ -222,11 +238,14 @@
               
   
               <map:match pattern="**/*.*">
  -                <map:redirect-to uri="{2}.{3}?location={1}"/>
  +                <map:act type="request">
  +                    <map:parameter name="parameters" value="true"/>
  +                    <map:redirect-to uri="../{../2}.xmap?location={location}"/>
  +                 </map:act>
  +                <map:redirect-to uri="../{2}.{3}?location={1}"/>
               </map:match>
   
  -            
  -            
  +-->            
   
           </map:pipeline>
   
  
  
  
  1.3       +4 -2      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/html/intro.xml
  
  Index: intro.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/html/intro.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- intro.xml	12 Dec 2003 04:48:50 -0000	1.2
  +++ intro.xml	17 Dec 2003 07:05:18 -0000	1.3
  @@ -8,11 +8,13 @@
   </p>
   <p>
       <b>Warning: This tool can show the contents of sitemaps, don't put this tool in a production environment for security reasons.</b>
  -    The source-viewing is turned on and off in the sitemap, in the "showsource" parameter and by setting the internal-only attribute of the "srcviewing"-pipeline.
  +    The source-viewing is turned on and off in the sitemap, by setting the internal-only attribute of the "srcviewing"-pipeline. 
  +    To be able to use all of the viewer, make sure to set internal-only attribute of the pipeline labeled "srcviewing" 
  +    to "no". To have a secure version, set it to "yes" (default).
   </p>
   <p>See this <a href="example.html">example of a difficult sitemap</a> to see where it won't work.</p>
   <p>
  -    It is in a testing stage, and some work, cleanup and documentation should still be done. It works fine on Cocoon 2.1.2.
  +    It is in a testing stage, and some work, cleanup and documentation should still be done. 
   </p>
   <p>
       <h4>Known bugs</h4>
  
  
  
  1.3       +2 -1      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemap2descr01.xsl
  
  Index: sitemap2descr01.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemap2descr01.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap2descr01.xsl	12 Dec 2003 04:48:51 -0000	1.2
  +++ sitemap2descr01.xsl	17 Dec 2003 07:05:18 -0000	1.3
  @@ -4,13 +4,14 @@
       <xsl:output indent="yes"/>
       
       <xsl:param name="location"/>
  +    <xsl:param name="filename"/>
       
       <xsl:variable name="sitemapInfo" select="//SitemapInfo"/>
       <xsl:variable name="globals" select="0"/>
       <xsl:variable name="nomatch" select="'::::*****:::::'"/>
       
       <xsl:template match="/">
  -        <sitemap location="{$location}"  >
  +        <sitemap location="{$location}" filename="{$filename}" >
               <info>
                   <xsl:call-template name="normalize-path">
                       <xsl:with-param name="path"  select="'123/hoep/..'"/>
  
  
  
  1.3       +37 -7     cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemapdescr2html.xsl
  
  Index: sitemapdescr2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemapdescr2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemapdescr2html.xsl	12 Dec 2003 04:48:51 -0000	1.2
  +++ sitemapdescr2html.xsl	17 Dec 2003 07:05:18 -0000	1.3
  @@ -25,7 +25,6 @@
                   <link href="SitemapInfo.css" type="text/css" rel="stylesheet" />
               </head>
               <body>
  -                
                   <script src="ie.js" type="text/javascript"/>
                   <table class="header">
                           <tr>
  @@ -33,10 +32,10 @@
                                   <xsl:if test="$showsources=1">
                                       <pre><a>
                                               <xsl:call-template name="popup-attrs">
  -                                                <xsl:with-param name="url" select="concat('src/sitemap.xmap?location=',@location)"/>
  +                                                <xsl:with-param name="url" select="concat('src/',substring-before(@filename,'.xmap'),'._xmap?location=',@location)"/>
                                                   <xsl:with-param name="target" select="'sitemapSrc'"/>
                                               </xsl:call-template>
  -                                            <xsl:value-of select="@location"/>/sitemap.xmap</a>
  +                                            <xsl:value-of select="concat(@location,'/',@filename)"/></a>
                                       <xsl:if test="$debug">
                                           <a href="{concat('descr?location=',@location)}">.</a>
                                       </xsl:if>
  @@ -371,19 +370,27 @@
               
           <td><table><tr>
               <td colspan="2">
  +
  +                <xsl:variable name="url">
  +                    <xsl:call-template name="make-url">
  +                        <xsl:with-param name="location" select="/*/sitemap/@location"/>
  +                        <xsl:with-param name="subloc" select="$afterslashes"/>
  +                    </xsl:call-template>
  +                </xsl:variable> 
  +
                   <xsl:choose>
                       <xsl:when test="$afterslashes=$nomatch">
                           <pre>[unknown]</pre>
                       </xsl:when>
                       <xsl:when test="name()='mount' and $afterslashes!='' and $files/*[.=$afterslashes]">
  -                        <pre><a href="{$afterslashes}"><xsl:value-of select="$afterslashes"/> </a></pre>
  +                        <pre><a href="{$url}"><xsl:value-of select="$afterslashes"/> </a></pre>
                       </xsl:when>
                       <xsl:when test="$afterslashes!='' and $showsources=1 and $files/*[.=$afterslashes]">
                           <!--xsl:variable name="url" select="concat('src/',$afterslashes)"/>
                           <xsl:variable name="target" select="srcpopup"/-->
                           <pre><a>
                               <xsl:call-template name="popup-attrs">
  -                                <xsl:with-param name="url" select="concat('src/',$afterslashes)"/>
  +                                <xsl:with-param name="url" select="$url"/> 
                                 </xsl:call-template>
   
                               <xsl:value-of select="$afterslashes"/> 
  @@ -396,7 +403,10 @@
                       <xsl:otherwise>
                       </xsl:otherwise>
                   </xsl:choose>
  -                <xsl:if test="name()='serialize' or name()='act'"><xsl:value-of select="name()"/></xsl:if>
  +                <xsl:choose>
  +                    <xsl:when test="name()='serialize' or name()='act'"><xsl:value-of select="name()"/></xsl:when>
  +                    <xsl:when test="name()='transform'">xlst</xsl:when>
  +                </xsl:choose>
               </td></tr>
             <tr class="comments">
               <td>
  @@ -408,7 +418,6 @@
                           <xsl:when test="$refinfo!=''">
                               <xsl:value-of select="$refinfo"/>
                           </xsl:when>
  -                        <xsl:when test="name()='transform'">xslt</xsl:when>
                           <xsl:when test="@element">
                               <xsl:value-of select="@element"/>
                           </xsl:when>
  @@ -458,5 +467,26 @@
       <xsl:attribute name="onclick"><xsl:value-of select="$urlscript"/></xsl:attribute>
   </xsl:template>
   
  +<xsl:template name="make-url">
  +    <xsl:param name="location"/>
  +    <xsl:param name="subloc"/>
  +    <xsl:choose>
  +        <xsl:when test="contains($subloc,'/')">
  +            <xsl:call-template name="make-url">
  +                <xsl:with-param name="location">
  +                    <xsl:choose>
  +                        <xsl:when test="$location!=''"><xsl:value-of select="concat($location,'/',substring-before($subloc,'/'))"/></xsl:when>
  +                        <xsl:otherwise><xsl:value-of select="substring-before($subloc,'/')"/></xsl:otherwise>
  +                    </xsl:choose>
  +                </xsl:with-param>
  +                <xsl:with-param name="subloc" select="substring-after($subloc,'/')"/>
  +            </xsl:call-template>
  +        </xsl:when>
  +        <xsl:when test="contains($subloc,'.xmap')">
  +            <xsl:value-of select="concat(substring-before($subloc,'.xmap'),'._xmap','?location=',$location)"/>
  +        </xsl:when>
  +        <xsl:otherwise><xsl:value-of select="concat('src/',$subloc,'?location=',$location)"/></xsl:otherwise>
  +    </xsl:choose>
  +</xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.3       +6 -4      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemaplinks.xsl
  
  Index: sitemaplinks.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemaplinks.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemaplinks.xsl	12 Dec 2003 04:48:51 -0000	1.2
  +++ sitemaplinks.xsl	17 Dec 2003 07:05:18 -0000	1.3
  @@ -10,13 +10,15 @@
   <xsl:template match="dir:directory">
   </xsl:template>
   
  -<xsl:template match="dir:file[contains(@name,'.xmap') and substring-after(@name,'.xmap')='']">
  -    <file>
  -    <xsl:apply-templates select="." mode="print"/>
  -    </file>
  +<xsl:template match="dir:file[contains(@name,'.xmap') and substring-after(@name,'.xmap')='' and ../@name!='..']">
       <dir>
           <xsl:apply-templates select=".." mode="print"/>
       </dir>
  +    <file>
  +        <xsl:attribute name="filename"><xsl:value-of select="@name"/></xsl:attribute>
  +        <xsl:attribute name="path"><xsl:apply-templates select=".." mode="print"/></xsl:attribute>
  +    <xsl:apply-templates select="." mode="print"/>
  +    </file>
   </xsl:template>
   
   
  
  
  
  1.3       +1 -1      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemaplist2index.xsl
  
  Index: sitemaplist2index.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemaplist2index.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemaplist2index.xsl	12 Dec 2003 04:48:51 -0000	1.2
  +++ sitemaplist2index.xsl	17 Dec 2003 07:05:18 -0000	1.3
  @@ -45,7 +45,7 @@
   
   <xsl:template match="file">
       <li>
  -        <a href="{.}"><xsl:value-of select="."/></a>
  +        <a href="{concat(substring-before(@filename,'.xmap'),'._xmap','?location=',@path)}"><xsl:value-of select="."/></a>
       </li>
   </xsl:template>