cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/precept/samples sitemap.xmap
Date Thu, 20 Nov 2003 17:12:46 GMT
joerg       2003/11/20 09:12:46

  Modified:    src/blocks/precept/samples/example1 view3.xsl view4.xsl
               src/blocks/precept/samples sitemap.xmap
  Log:
  - transformer in transformation package
  - simplified nested matchers
  - fixed example1: 'cocoon-action-*' => 'cocoon-method-*'
  
  Revision  Changes    Path
  1.3       +72 -45    cocoon-2.1/src/blocks/precept/samples/example1/view3.xsl
  
  Index: view3.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/samples/example1/view3.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- view3.xsl	6 May 2003 14:12:56 -0000	1.2
  +++ view3.xsl	20 Nov 2003 17:12:45 -0000	1.3
  @@ -2,16 +2,23 @@
   
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                 xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  -   <xsl:template match="root">
  -     <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
  -   </xsl:template>
  -   
  -   <xsl:template match="cocoon-installation">
  -     <table border="1">
  -     <tr>
  -       <td>os</td>
  -       <td>
  -          <select name="cocoon-installation/system/os"> 
  +
  +  <xsl:template match="root">
  +    <html>
  +      <body>
  +        <form method="POST">
  +          <xsl:apply-templates/>
  +        </form>
  +      </body>
  +    </html>
  +  </xsl:template>
  +
  +  <xsl:template match="cocoon-installation">
  +    <table border="1">
  +      <tr>
  +        <td>os</td>
  +        <td>
  +          <select name="cocoon-installation/system/os">
               <option value="linux">
                 <xsl:if test="system/os = 'linux'">
                   <xsl:attribute name="selected"/>
  @@ -24,42 +31,62 @@
                 </xsl:if>
                 Windows 2k
               </option>
  -          </select>          
  -       </td>
  -       <td><xsl:apply-templates select="system/os/constraint"/></td>
  -     </tr>
  -     <tr>
  -       <td>processor</td>
  -       <td><input type="textbox" name="cocoon-installation/system/processor" value="{system/processor/text()}"/></td>
  -       <td><xsl:apply-templates select="system/processor/constraint"/></td>
  -     </tr>
  -     <tr>
  -       <td>ram</td>
  -       <td><input type="textbox" name="cocoon-installation/system/ram" value="{system/ram/text()}"/></td>
  -       <td><xsl:apply-templates select="system/ram/constraint"/></td>
  -     </tr>
  -     <tr>
  -       <td>servlet engine</td>
  -       <td><input type="textbox" name="cocoon-installation/system/servlet-engine"
value="{system/servlet-engine/text()}"/></td>
  -       <td><xsl:apply-templates select="system/servlet-engine/constraint"/></td>
  -     </tr>
  -     <tr>
  -       <td>java version</td>
  -       <td><input type="textbox" name="cocoon-installation/system/java-version"
value="{system/java-version/text()}"/></td>
  -       <td><xsl:apply-templates select="system/java-version/constraint"/></td>
  -     </tr>
  +          </select>
  +        </td>
  +        <td>
  +          <xsl:apply-templates select="system/os/constraint"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>processor</td>
  +        <td>
  +          <input type="textbox" name="cocoon-installation/system/processor" value="{system/processor/text()}"/>
  +        </td>
  +        <td>
  +          <xsl:apply-templates select="system/processor/constraint"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>ram</td>
  +        <td>
  +          <input type="textbox" name="cocoon-installation/system/ram" value="{system/ram/text()}"/>
  +        </td>
  +        <td>
  +          <xsl:apply-templates select="system/ram/constraint"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>servlet engine</td>
  +        <td>
  +          <input type="textbox" name="cocoon-installation/system/servlet-engine" value="{system/servlet-engine/text()}"/>
  +        </td>
  +        <td>
  +          <xsl:apply-templates select="system/servlet-engine/constraint"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>java version</td>
  +        <td>
  +          <input type="textbox" name="cocoon-installation/system/java-version" value="{system/java-version/text()}"/>
  +        </td>
  +        <td>
  +          <xsl:apply-templates select="system/java-version/constraint"/>
  +        </td>
  +      </tr>
  +    </table>
  +    <input type="submit" name="cocoon-method-prev2" value="Prev Page"/>
  +    <input type="submit" name="cocoon-method-next4" value="Next Page"/>
  +  </xsl:template>
   
  -     </table>
  -     <input type="submit" name="cocoon-action-prev2" value="Prev Page"/>     
  -     <input type="submit" name="cocoon-action-next4" value="Next Page"/>     
  -   </xsl:template>
  -   
  -   <xsl:template match="/|*">
  -      <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
  -   </xsl:template>
  +  <xsl:template match="/|*">
  +    <xsl:copy>
  +      <xsl:copy-of select="@*"/>
  +      <xsl:apply-templates/>
  +    </xsl:copy>
  +  </xsl:template>
   
  -   <xsl:template match="text()">
  -      <xsl:value-of select="." />
  -   </xsl:template>
  +  <xsl:template match="text()">
  +    <xsl:value-of select="."/>
  +  </xsl:template>
   </xsl:stylesheet>
   
  
  
  
  1.3       +99 -70    cocoon-2.1/src/blocks/precept/samples/example1/view4.xsl
  
  Index: view4.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/samples/example1/view4.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- view4.xsl	6 May 2003 14:12:56 -0000	1.2
  +++ view4.xsl	20 Nov 2003 17:12:45 -0000	1.3
  @@ -2,76 +2,105 @@
   
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                 xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  -   <xsl:template match="root">
  -     <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
  -   </xsl:template>
  -   
  -   <xsl:template match="cocoon-installation">
  -     <table border="1">
   
  -     <tr>
  -       <td>Firstname</td>
  -       <td><xsl:value-of select="user/firstname/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>Lastname</td>
  -       <td><xsl:value-of select="user/lastname/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>Email</td>
  -       <td><xsl:value-of select="user/email/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>Age</td>
  -       <td><xsl:value-of select="user/age/text()"/></td>
  -     </tr>
  -
  -     <tr>
  -       <td>Installation number</td>
  -       <td><xsl:value-of select="number/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>Live URL</td>
  -       <td><xsl:value-of select="live-url/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>Please publish it as cocoon live-site example</td>
  -       <td><xsl:value-of select="publish/text()"/></td>
  -     </tr>
  -
  -     <tr>
  -       <td>os</td>
  -       <td><xsl:value-of select="system/os/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>processor</td>
  -       <td><xsl:value-of select="system/processor/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>ram</td>
  -       <td><xsl:value-of select="system/ram/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>servlet engine</td>
  -       <td><xsl:value-of select="system/servlet-engine/text()"/></td>
  -     </tr>
  -     <tr>
  -       <td>java version</td>
  -       <td><xsl:value-of select="system/java-version/text()"/></td>
  -     </tr>
  -
  -
  -     </table>
  -     <input type="submit" name="cocoon-action-prev3" value="Prev Page"/>     
  -     <input type="submit" name="cocoon-action-submit" value="Submit"/>     
  -   </xsl:template>
  -   
  -   <xsl:template match="/|*">
  -      <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
  -   </xsl:template>
  -
  -   <xsl:template match="text()">
  -      <xsl:value-of select="." />
  -   </xsl:template>
  +  <xsl:template match="root">
  +    <html>
  +      <body>
  +        <form method="POST">
  +          <xsl:apply-templates/>
  +        </form>
  +      </body>
  +    </html>
  +  </xsl:template>
  +
  +  <xsl:template match="cocoon-installation">
  +    <table border="1">
  +      <tr>
  +        <td>Firstname</td>
  +        <td>
  +          <xsl:value-of select="user/firstname/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Lastname</td>
  +        <td>
  +          <xsl:value-of select="user/lastname/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Email</td>
  +        <td>
  +          <xsl:value-of select="user/email/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Age</td>
  +        <td>
  +          <xsl:value-of select="user/age/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Installation number</td>
  +        <td>
  +          <xsl:value-of select="number/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Live URL</td>
  +        <td>
  +          <xsl:value-of select="live-url/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>Please publish it as cocoon live-site example</td>
  +        <td>
  +          <xsl:value-of select="publish/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>os</td>
  +        <td>
  +          <xsl:value-of select="system/os/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>processor</td>
  +        <td>
  +          <xsl:value-of select="system/processor/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>ram</td>
  +        <td>
  +          <xsl:value-of select="system/ram/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>servlet engine</td>
  +        <td>
  +          <xsl:value-of select="system/servlet-engine/text()"/>
  +        </td>
  +      </tr>
  +      <tr>
  +        <td>java version</td>
  +        <td>
  +          <xsl:value-of select="system/java-version/text()"/>
  +        </td>
  +      </tr>
  +    </table>
  +    <input type="submit" name="cocoon-action-prev3" value="Prev Page"/>
  +    <input type="submit" name="cocoon-action-submit" value="Submit"/>
  +  </xsl:template>
  +
  +  <xsl:template match="/|*">
  +    <xsl:copy>
  +      <xsl:copy-of select="@*"/>
  +      <xsl:apply-templates/>
  +    </xsl:copy>
  +  </xsl:template>
  +
  +  <xsl:template match="text()">
  +    <xsl:value-of select="."/>
  +  </xsl:template>
   </xsl:stylesheet>
   
  
  
  
  1.3       +22 -26    cocoon-2.1/src/blocks/precept/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/samples/sitemap.xmap,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap.xmap	11 Mar 2003 15:43:27 -0000	1.2
  +++ sitemap.xmap	20 Nov 2003 17:12:46 -0000	1.3
  @@ -1,15 +1,14 @@
   <?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:transformer name="instance" src="org.apache.cocoon.precept.InstanceTransformer"
logger="webapp.validation"/>
  +      <map:transformer name="instance" src="org.apache.cocoon.precept.transformation.InstanceTransformer"
logger="webapp.validation"/>
       </map:transformers>
       <map:readers default="resource"/>
       <map:serializers default="html"/>
  -    <map:matchers default="wildcard"/>    
  +    <map:matchers default="wildcard"/>
       <map:selectors default="browser"/>
       <map:actions>
         <map:action name="demo" src="org.apache.cocoon.precept.acting.PreceptorDemoAction"
logger="webapp.validation"/>
  @@ -24,11 +23,11 @@
         </map:match>
   
         <map:match pattern="welcome">
  -          <map:generate src="samples.xml"/>
  -    	  <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
  -    	     <map:parameter name="contextPath" value="{request:contextPath}"/>
  -    	  </map:transform>
  -          <map:serialize/>
  +        <map:generate src="samples.xml"/>
  +        <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
  +          <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        </map:transform>
  +        <map:serialize/>
         </map:match>
   
         <map:match pattern="model.xml">
  @@ -39,26 +38,22 @@
         <map:match pattern="**.html">
           <map:act type="request">
   
  -          <map:match pattern="app/**">
  -            <map:match pattern="**/example1.*">
  -              <map:act type="demo">
  -                <map:generate src="example1/{page}.xml"/>
  -                <map:transform type="instance"/>
  -                <map:transform src="example1/{page}.xsl"/>
  -                <map:serialize/>
  -              </map:act>
  -            </map:match>
  +          <map:match pattern="app/example1.*">
  +            <map:act type="demo">
  +              <map:generate src="example1/{page}.xml"/>
  +              <map:transform type="instance"/>
  +              <map:transform src="example1/{page}.xsl"/>
  +              <map:serialize/>
  +            </map:act>
             </map:match>
   
  -          <map:match pattern="app/**">
  -            <map:match pattern="**/example2.*">
  -              <map:act type="demo">
  -                <map:generate src="example2/{page}.xml"/>
  -                <map:transform type="instance"/>
  -                <map:transform src="example2/i2html.xsl"/>
  -                <map:serialize/>
  -              </map:act>
  -            </map:match>
  +          <map:match pattern="app/example2.*">
  +            <map:act type="demo">
  +              <map:generate src="example2/{page}.xml"/>
  +              <map:transform type="instance"/>
  +              <map:transform src="example2/i2html.xsl"/>
  +              <map:serialize/>
  +            </map:act>
             </map:match>
   
           </map:act>
  @@ -67,3 +62,4 @@
   
     </map:pipelines>
   </map:sitemap>
  +
  
  
  

Mime
View raw message