You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by rg...@apache.org on 2005/08/23 00:04:07 UTC

svn commit: r239257 - in /cocoon/gsoc/rgraham/refdoc/samples/snippets: add-attrs-neutralDoc.xsl clear-bad-keys.xsl neutral-ordering.xsl sitemap.xmap

Author: rgraham
Date: Mon Aug 22 15:03:58 2005
New Revision: 239257

URL: http://svn.apache.org/viewcvs?rev=239257&view=rev
Log:
Modified Sitemap to use the new XSLT.

Created clear-bad-keys.xsl and neutral-ordering.xsl to clear out keys that were not searched in the results for and ordering the results logically.

Added:
    cocoon/gsoc/rgraham/refdoc/samples/snippets/clear-bad-keys.xsl
    cocoon/gsoc/rgraham/refdoc/samples/snippets/neutral-ordering.xsl
Modified:
    cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl
    cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap

Modified: cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl?rev=239257&r1=239256&r2=239257&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl Mon Aug 22 15:03:58 2005
@@ -47,6 +47,9 @@
         </xsl:attribute>
         <xsl:attribute name="key">
             <xsl:value-of select="descendant::key/."/>
+        </xsl:attribute>
+        <xsl:attribute name="name">
+            <xsl:value-of select="descendant::name/."/>
         </xsl:attribute>
 </xsl:attribute-set> 
   

Added: cocoon/gsoc/rgraham/refdoc/samples/snippets/clear-bad-keys.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/clear-bad-keys.xsl?rev=239257&view=auto
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/clear-bad-keys.xsl (added)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/clear-bad-keys.xsl Mon Aug 22 15:03:58 2005
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<!--
+  Clear out documents in the search that don't have the right key
+  SVN $Id: add-attrs-neutralDoc.xsl,v 1.1 2005/06/02 16:28:35 bdelacretaz Exp $
+ -->
+<xsl:transform version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:param name="query"/> 
+
+  <xsl:template match="/">
+    <xsl:element name="{$query}">
+        <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+    <xsl:template match="snippet[@key=$query]"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+  </xsl:template>
+  
+</xsl:transform>
\ No newline at end of file

Added: cocoon/gsoc/rgraham/refdoc/samples/snippets/neutral-ordering.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/neutral-ordering.xsl?rev=239257&view=auto
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/neutral-ordering.xsl (added)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/neutral-ordering.xsl Mon Aug 22 15:03:58 2005
@@ -0,0 +1,126 @@
+<?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.
+-->
+
+<!--
+  Begin the filtering of snippets to create the right document structure and ordering
+  SVN $Id: add-attrs-neutralDoc.xsl,v 1.1 2005/06/02 16:28:35 bdelacretaz Exp $
+ -->
+<xsl:transform version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+  <xsl:template match="/">
+      <xsl:copy>
+      
+      <here>
+      
+        <xsl:apply-templates select="//snippet[@type='name']"/>
+        <xsl:apply-templates select="//snippet[@type='description']"/>
+        <xsl:apply-templates select="//snippet[@type='details']"/>
+        <xsl:apply-templates select="//snippet[@type='see-also']"/>
+        <xsl:apply-templates select="//snippet[@type='warnings']"/>
+        <xsl:apply-templates select="//snippet[@type='sitemap-param']"/> 
+        <xsl:apply-templates select="//snippet[@type='component-param']"/> 
+        <xsl:apply-templates select="//snippet[@type='sitemap-example']"/> 
+        <xsl:apply-templates select="//snippet[@type='xsp-example']"/> 
+        <xsl:apply-templates select="//snippet[@type='flow-example']"/> 
+        <xsl:apply-templates select="//snippet[@type='form-example']"/> 
+                
+      </here>
+                
+      </xsl:copy>
+  </xsl:template>
+
+    <xsl:template match="snippet[@type='name']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template>
+   
+    <xsl:template match="snippet[@type='description']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template>
+    
+    <xsl:template match="snippet[@type='details']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template>
+    
+    <xsl:template match="snippet[@type='see-also']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template>
+    
+    <xsl:template match="snippet[@type='warnings']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template>
+    
+    <xsl:template match="snippet[@type='sitemap-param']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+    
+    <xsl:template match="snippet[@type='component-param']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+    
+    
+    <xsl:template match="snippet[@type='sitemap-example']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+
+        <xsl:template match="snippet[@type='xsp-example']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+    
+        <xsl:template match="snippet[@type='flow-example']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+    
+        <xsl:template match="snippet[@type='form-example']"> 
+        <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="descendant::*"/>
+        </xsl:copy> 
+    </xsl:template> 
+
+</xsl:transform>
\ No newline at end of file

Modified: cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap?rev=239257&r1=239256&r2=239257&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap Mon Aug 22 15:03:58 2005
@@ -89,6 +89,10 @@
         <map:transform src="add-attrs-neutralDoc.xsl">
             <map:parameter name="query" value="{1}"/>
         </map:transform>
+        <map:transform src="clear-bad-keys.xsl"> 
+            <map:parameter name="query" value="{1}"/>
+        </map:transform>
+        <map:transform src="neutral-ordering.xsl"/> 
         <map:serialize type="xml"/>
       </map:match>