cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] Updated: BeginnerSimpleWebappOrganisation
Date Wed, 22 Sep 2004 19:08:48 GMT
   Date: 2004-09-22T12:08:47
   Editor: JamesMason <masonjm@ah.org>
   Wiki: Cocoon Wiki
   Page: BeginnerSimpleWebappOrganisation
   URL: http://wiki.apache.org/cocoon/BeginnerSimpleWebappOrganisation

   Minor formatting fixes

Change Log:

------------------------------------------------------------------------------
@@ -51,12 +51,12 @@
 I will point you to a detail right in the middle of the originally 
 distributed {{{$cocoon_root/sitemap.xmap}}} (near line 860):
 There you find following code snippet (i took off the comments here):
-{{{
-<map:pipeline>
-  <map:match pattern="mount/*/**">
-    <map:mount check-reload="yes" src="mount/{1}/" uri-prefix="mount/{1}"/>
-  </map:match>
-</map:pipeline>
+{{{
+<map:pipeline>
+  <map:match pattern="mount/*/**">
+    <map:mount check-reload="yes" src="mount/{1}/" uri-prefix="mount/{1}"/>
+  </map:match>
+</map:pipeline>
 }}}
 This little piece of the sitemap allows you to separate your work cleanly 
 from the rest of cocoon. What does it do ? Look at the 
@@ -71,7 +71,7 @@
 
 When the interpreter hits the wildcard character '*' or the sequence '**' in the pattern,

 it will automatically resolve the actual value into local ''sitemap-parameters'', where the
-first wildcard-character is resolved into the parameter {1}, then secnd wildchard-character
is
+first wildcard-character is resolved into the parameter {1}, then second wildchard-character
is
 resolved into the parameter {2}, ... 
 
 Following rules apply:
@@ -82,11 +82,11 @@
 These abstract rules can best be understood by looking at an example. In the following
 we apply the URL (given in the first line) to the match-pattern (in the secnd line):
 
-{{{
-http://localhost:8080/cocoon/ mount/ work/index.xml   <-- URL
-~~~~~~~~~~~a~~~~~~~~~~~~~~~~~ ~~b~~~ ~~c~d~e~~~~~~~ 
-                              mount/   * / **         <-- pattern
-                                      {1}  {2}        <-- sitemap-parameters
+{{{
+http://localhost:8080/cocoon/ mount/ work/index.xml   <-- URL
+~~~~~~~~~~~a~~~~~~~~~~~~~~~~~ ~~b~~~ ~~c~d~e~~~~~~~ 
+                              mount/   * / **         <-- pattern
+                                      {1}  {2}        <-- sitemap-parameters
 }}}
 Here Cocoon associates the string "work" to the parameter {1} and the string "index.xml"
to 
 the parameter {2}. These parameters can be freely used within the pipeline snippet as you
can 
@@ -108,29 +108,29 @@
 files you want to serve have the ending ".xml". The setup is then straightforward:
 
  *  Enter your work folder
- *  Create a new sitemap.xmap within your "work" folder and place following content into
the newly created file:{{{
-<?xml version="1.0"?>
-<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-
-  <map:components>
-    <map:generators   default="file"/>
-    <map:transformers default="xslt"/>
-    <map:readers      default="resource"/>
-    <map:serializers  default="html"/>
-    <map:matchers default="wildcard"/>
-  </map:components>
-
-  <map:pipelines>
-    <map:pipeline>
-      <!-- xml files -->
-      <map:match pattern="*.html">
-        <map:generate src="{1}.xml"/>
-        <map:transform src="mytransform.xsl"/>
-        <map:serialize type="html"/>
-      </map:match>
-    </map:pipeline>
-  </map:pipelines>
-</map:sitemap>
+ *  Create a new sitemap.xmap within your "work" folder and place following content into
the newly created file: {{{
+<?xml version="1.0"?>
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <map:generators   default="file"/>
+    <map:transformers default="xslt"/>
+    <map:readers      default="resource"/>
+    <map:serializers  default="html"/>
+    <map:matchers default="wildcard"/>
+  </map:components>
+
+  <map:pipelines>
+    <map:pipeline>
+      <!-- xml files -->
+      <map:match pattern="*.html">
+        <map:generate src="{1}.xml"/>
+        <map:transform src="mytransform.xsl"/>
+        <map:serialize type="html"/>
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>
 }}}
 
 === What did we achieve? ===
@@ -171,33 +171,33 @@
 
 An xml you can put on your work directory (index.xml):
 
-{{{
-   <?xml version="1.0"?>
-    <page>
-      <title>Basic XML/XSL Transformation Example </title>
-      <greeting>Hello World</greeting>
-    </page>
+{{{
+   <?xml version="1.0"?>
+    <page>
+      <title>Basic XML/XSL Transformation Example </title>
+      <greeting>Hello World</greeting>
+    </page>
 }}}
 
 An XSL stylesheet (mytransform.xsl) for above:
 
-{{{
-   <?xml version="1.0"?>
-   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-    <xsl:template match="page">
-     <html>
-      <head>
-       <title><xsl:value-of select="title"/></title>
-      </head>
-      <body>
-       <h1><xsl:value-of select="title"/></h1>
-       <p><xsl:value-of select="greeting"/></p>
-      </body>
-     </html>
-    </xsl:template>
-
-   </xsl:stylesheet>
+{{{
+   <?xml version="1.0"?>
+   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+    <xsl:template match="page">
+     <html>
+      <head>
+       <title><xsl:value-of select="title"/></title>
+      </head>
+      <body>
+       <h1><xsl:value-of select="title"/></h1>
+       <p><xsl:value-of select="greeting"/></p>
+      </body>
+     </html>
+    </xsl:template>
+
+   </xsl:stylesheet>
 }}}
 
 (Note: Make sure that the first processing instruction (<?xml version="1.0"?>) in the
XML document has no spaces before it, this will result in an internal server error)
@@ -205,7 +205,7 @@
 ----
 ===  page metadata ===
 - AUTHOR: Dabbous[[BR]]
-- AUTHOR-CONTACT: mailto:hussayn.dabbous@saxess.de[[BR]]
-- REVIEWED-BY: [:DerekH] (minor editing)[[BR]] Maskkkk (Added note at bottom)[[BR]]
-- REVIEWER-CONTACT:[[BR]]
+- AUTHOR-CONTACT: mailto:hussayn.dabbous@saxess.de [[BR]]
+- REVIEWED-BY: [:DerekH] (minor editing)[[BR]] Maskkkk (Added note at bottom)[[BR]] JamesMason
(minor formatting)[[BR]]
+- REVIEWER-CONTACT: [[BR]]
 ---- 

Mime
View raw message