You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2004/03/10 15:26:30 UTC

cvs commit: cocoon-2.1/src/webapp/samples/soap/stylesheets soap-getquote1.xsl soap-getquote3.xsl

stephan     2004/03/10 06:26:30

  Modified:    src/blocks/xsp/samples samples.xml sitemap.xmap
               src/webapp/samples samples.xml
  Added:       src/blocks/xsp/samples/soap samples.xml sitemap.xmap
               src/blocks/xsp/samples/soap/pages currency.xsp
                        temperature.xsp
               src/blocks/xsp/samples/soap/pages/xscript getquote1.xsp
                        getquote2.xsp getquote3.xsp simple.xsp test.xsp
               src/blocks/xsp/samples/soap/stylesheets soap-getquote1.xsl
                        soap-getquote3.xsl
  Removed:     src/webapp/samples/soap samples.xml sitemap.xmap
               src/webapp/samples/soap/pages currency.xsp temperature.xsp
               src/webapp/samples/soap/pages/xscript getquote1.xsp
                        getquote2.xsp getquote3.xsp simple.xsp test.xsp
               src/webapp/samples/soap/stylesheets soap-getquote1.xsl
                        soap-getquote3.xsl
  Log:
  Moving the SOAP example into the xsp block.
  
  Revision  Changes    Path
  1.2       +11 -1     cocoon-2.1/src/blocks/xsp/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xsp/samples/samples.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- samples.xml	10 Mar 2004 12:58:08 -0000	1.1
  +++ samples.xml	10 Mar 2004 14:26:28 -0000	1.2
  @@ -92,4 +92,14 @@
      </sample>
     </group>
   
  +  <group name="More examples">
  +    <sample href="soap/" name="SOAP">
  +      Cocoon ships with facilities for immediate connection to SOAP resources.
  +      These examples show you how to connect to any web service with a few
  +      lines of XML markup using SOAP XSP Logicsheet. See also axis block that
  +      integrates Axis into Cocoon.
  +    </sample>
  +  </group>
  +
  +
   </samples>
  
  
  
  1.2       +4 -0      cocoon-2.1/src/blocks/xsp/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xsp/samples/sitemap.xmap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sitemap.xmap	10 Mar 2004 12:58:08 -0000	1.1
  +++ sitemap.xmap	10 Mar 2004 14:26:28 -0000	1.2
  @@ -87,6 +87,10 @@
           <map:serialize/>
         </map:match>
   
  +      <map:match pattern="soap/**">
  +        <map:mount uri-prefix="soap" src="soap/" check-reload="yes"/>
  +      </map:match>
  +
       </map:pipeline>
     </map:pipelines>
   </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/samples.xml
  
  Index: samples.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  <!--
    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.
  -->
  
  <!-- CVS $Id: samples.xml,v 1.1 2004/03/10 14:26:29 stephan Exp $ -->
  
  <samples name="SOAP Samples">
  
    <group name="Back">
     <sample name="Back" href="../">
      Back to the samples home page.
     </sample>
    </group>
  
    <group name="SOAP">
     <sample name="Temperature" href="temperature">
      Find out the current temperature in Beverly Hills, CA.
     </sample>
     <sample name="Currency Conversion" href="currency">
      Get the current Euro/USDollar exchange rate.
     </sample>
    </group>
     
    <group name="SOAP Logicsheet">
     <sample name="Simple XScript Sample" href="xscript/simple">
      A simple sample showing XScript logicsheet which is used as foundation
      for the SOAP logicsheet.
     </sample>
     <sample name="XScript Test" href="xscript/test">
      Sample testing XScript logicsheet functionality.
     </sample> 
     <sample name="SOAP Sample 1" href="xscript/getquote1">
      This page demonstrates the SOAP logicsheet for
      Cocoon. It accesses a SOAP service that provides stock quotes
      and displays the result.
     </sample>
     <sample name="SOAP Sample 2" href="xscript/getquote2">
      This example uses an inline XSLT stylesheet and an
      XScript transform instruction to extract the stock
      price.
     </sample>
     <sample name="SOAP Sample 3" href="xscript/getquote3">
      This is yet another example of the XScript and SOAP
      logicsheets. This sample is very similar with
      SOAP Sample 2, except that the stylesheet is defined in an external file.
     </sample>
    </group>
   
  </samples>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?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.
  -->
  
  <!-- CVS $Id: sitemap.xmap,v 1.1 2004/03/10 14:26:29 stephan Exp $ -->
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
   <map:pipelines>
     <map:pipeline>
  
     <map:match pattern="">
       <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>
  
     <!-- ======================== XScript Samples ========================= -->
  
     <map:match pattern="xscript/getquote1">
       <map:generate src="pages/xscript/getquote1.xsp" type="serverpages"/>
       <map:transform src="stylesheets/soap-getquote1.xsl"/>
       <map:transform src="context://samples/stylesheets/dynamic-page2html.xsl">
          <map:parameter name="servletPath" value="{request:servletPath}"/>
          <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          <map:parameter name="contextPath" value="{request:contextPath}"/>
          <map:parameter name="file" value="pages/{0}.xsp"/>
          <map:parameter name="remove" value="{0}"/>
       </map:transform>
       <map:serialize/>
     </map:match>
  
     <map:match pattern="xscript/*">
       <map:generate src="pages/xscript/{1}.xsp" type="serverpages"/>
       <map:transform src="context://samples/stylesheets/dynamic-page2html.xsl">
          <map:parameter name="servletPath" value="{request:servletPath}"/>
          <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          <map:parameter name="contextPath" value="{request:contextPath}"/>
          <map:parameter name="file" value="pages/{0}.xsp"/>
          <map:parameter name="remove" value="{0}"/>
       </map:transform>
       <map:serialize/>
     </map:match>   
  
     <!-- ======================== XScript Samples ========================= -->
              
     <map:match pattern="*">
      <map:generate src="pages/{1}.xsp" type="serverpages"/>
      <map:transform src="context://stylesheets/system/xml2html.xslt"/>
      <map:serialize/>
     </map:match>
  
     </map:pipeline>                
   </map:pipelines>
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/currency.xsp
  
  Index: currency.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  <xsp:page
    language="java"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:xscript="http://apache.org/xsp/xscript/1.0"
    xmlns:soap="http://apache.org/xsp/soap/3.0"
    >
    
    <page>
        <soap:call url="http://services.xmethods.net:9090/soap">
            <ns1:getRate xmlns:ns1="urn:xmethods-CurrencyExchange" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
                <soap:enc/>
                <country1 xsi:type="xsd:string">euro</country1>
                <country2 xsi:type="xsd:string">united states</country2>
            </ns1:getRate>      
        </soap:call>
    </page>
    
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/temperature.xsp
  
  Index: temperature.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  <xsp:page
    language="java"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:xscript="http://apache.org/xsp/xscript/1.0"
    xmlns:soap="http://apache.org/xsp/soap/3.0"
    >
    
    <page>
        <soap:call url="http://services.xmethods.net:80/soap/servlet/rpcrouter">
          <ns1:getTemp xmlns:ns1="urn:xmethods-Temperature">
            <soap:enc/>
   		  <zipcode xsi_type="xsd:string">90210</zipcode> 
          </ns1:getTemp>
        </soap:call>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/xscript/getquote1.xsp
  
  Index: getquote1.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
    Date: October 9, 2001
    CVS $Id: getquote1.xsp,v 1.1 2004/03/10 14:26:29 stephan Exp $
   -->
  
  <xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:xsp-request="http://apache.org/xsp/request/2.0"
            xmlns:xscript="http://apache.org/xsp/xscript/1.0"
            xmlns:soap="http://apache.org/xsp/soap/3.0">
    <page>
      <title>SOAP Stock Quote Example 1</title>
  
      <content>
        <xsp:logic>
          String symbol = request.getParameter("symbol");
  
          if (symbol == null || symbol.equals("")) {
             <para>This page demonstrates the SOAP logicsheet for
             Cocoon2. It accesses a SOAP service that provides stock quotes
             and displays the result.</para>
  
             <para>The SOAP result is placed in the generated page, and the
             stock price is extracted from it using an external XSLT
             stylesheet. Compare this approach with the one used in
             <code>soap-getquote2.xsp</code>, which uses an internal XScript
             stylesheet to extract the stock price.</para>
  
             <para>Please enter the stock ticker: </para>
             <form href="soap-getquote">
               <input name="symbol" type="text" value="HPQ"/>
               <input value="Do it!" type="submit"/>
             </form>
          } else {
            <para>The stock price for <xsp:expr>symbol</xsp:expr> is 
  
              <soap:call url="http://services.xmethods.net:80/soap">
                <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
                  <soap:enc/>
                  <symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
                </ns1:getQuote>
              </soap:call>
            </para>
  
            <form href="soap-getquote">
              <input value="Back" type="submit"/>
            </form>
          }
        </xsp:logic>
      </content>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/xscript/getquote2.xsp
  
  Index: getquote2.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
    Date: October 9, 2001
    CVS $Id: getquote2.xsp,v 1.1 2004/03/10 14:26:29 stephan Exp $
   -->
  
  <xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:xsp-request="http://apache.org/xsp/request/2.0"
            xmlns:xscript="http://apache.org/xsp/xscript/1.0"
            xmlns:soap="http://apache.org/xsp/soap/3.0">
  
    <page>
      <title>SOAP Stock Quote Example 2</title>
  
      <content>
        <xsp:logic>
          String symbol = request.getParameter("symbol");
          if (symbol == null || symbol.equals("")) {
            <para>This page demonstrates the SOAP logicsheet for
            Cocoon2. It accesses a SOAP service that provides stock quotes
            and displays the result.</para>
  
            <para>This example uses an inline XSLT stylesheet and an
            XScript <code>transform</code> instruction to extract the stock
            price. Compare this with the approach used in
            <code>soap-getquote1.xsp</code>, which uses a sitemap XSLT
            transformer to achieve the same thing.</para>
  
            <para>Please enter the stock ticker: </para>
            <form href="soap-getquote">
              <input name="symbol" type="text" value="HPQ"/>
              <input value="Do it!" type="submit"/>
            </form>
          } else {
            <para>The stock price for <xsp:expr>symbol</xsp:expr> is 
              <xscript:variable name="soap-result">
                <soap:call url="http://services.xmethods.net:80/soap">
                  <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
                    <soap:enc/>
                    <symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
                  </ns1:getQuote>
                </soap:call>
              </xscript:variable>
  
              <xscript:variable name="stylesheet">
                <xsl:stylesheet version="1.0"
                                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                                xmlns:n="urn:xmethods-delayed-quotes"
                                exclude-result-prefixes="soap n">
                  <xsl:template match="/">
                    <b>
                      <xsl:value-of select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/>
                    </b>
                  </xsl:template>
                </xsl:stylesheet>
              </xscript:variable>
  
              <xscript:transform name="soap-result" stylesheet="stylesheet"/>
            </para>
  
            <form href="soap-getquote">
              <input value="Back" type="submit"/>
            </form>
          }
        </xsp:logic>
      </content>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/xscript/getquote3.xsp
  
  Index: getquote3.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
    Date: October 9, 2001
    CVS $Id: getquote3.xsp,v 1.1 2004/03/10 14:26:29 stephan Exp $
   -->
  
  <xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:xsp-request="http://apache.org/xsp/request/2.0"
            xmlns:xscript="http://apache.org/xsp/xscript/1.0"
            xmlns:soap="http://apache.org/xsp/soap/3.0">
    <page>
      <title>SOAP Stock Quote Example 3</title>
  
      <content>
  
        <xsp:logic>
          String symbol = request.getParameter("symbol");
          if (symbol == null || symbol.equals("")) {
             <para>This page demonstrates the SOAP logicsheet for
             Cocoon2. It accesses a SOAP service that provides stock quotes
             and displays the result.</para>
  
             <para>This is yet another example of the XScript and SOAP
             logicsheets. This sample is very similar with
             <code>soap-getquote2.xsp</code>, except that the stylesheet is
             defined in an external file.
             </para>
  
             <para>Please enter the stock ticker: </para>
             <form href="soap-getquote">
               <input name="symbol" type="text" value="HPQ"/>
               <input value="Do it!" type="submit"/>
             </form>
          } else {
            <para>
              The stock price for <xsp:expr>symbol</xsp:expr> is 
  
              <xscript:variable name="soap-result">
                <soap:call url="http://services.xmethods.net:80/soap">
                  <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
                    <soap:enc/>
                    <symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
                  </ns1:getQuote>
                </soap:call>
              </xscript:variable>
  
              <xscript:variable name="stylesheet"
                                href="stylesheets/soap-getquote3.xsl"/>
  
              <xscript:transform name="soap-result" stylesheet="stylesheet"/>
            </para>
  
            <form href="soap-getquote">
              <input value="Back" type="submit"/>
            </form>
          }
        </xsp:logic>
      </content>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/xscript/simple.xsp
  
  Index: simple.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
    Date: September 18, 2001
    CVS $Id: simple.xsp,v 1.1 2004/03/10 14:26:29 stephan Exp $
   -->
  
  <xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:xsp-request="http://apache.org/xsp/request/2.0"
            xmlns:xscript="http://apache.org/xsp/xscript/1.0">
    <page>
      <title>Inline XScript variable</title>
  
      <content>
        <para>
          This is a simple XSP page demonstrating how to work with
          inline XScript variables. This example show how one can create
          and later refer to an XScript variable.
        </para>
  
        <xscript:variable name="my-var">
          <b>123</b>
        </xscript:variable>
  
        <para>
          The content of the XScript variable is: <xscript:get name="my-var"/>.
        </para>
  
        <para>
          We now remove the Xscript variable "my-var", and try to access
          it again. You should see an error message indicating it's no
          longer available.
        </para>
  
        <para>
          <xscript:remove name="my-var"/>
          <xscript:get name="my-var"/>
        </para>
      </content>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/pages/xscript/test.xsp
  
  Index: test.xsp
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
    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.
  -->
  
  <!--
    Author: Vadim Gritsenko "vgritsenko@apache.org"
    CVS $Id: test.xsp,v 1.1 2004/03/10 14:26:29 stephan Exp $
   -->
  
  <xsp:page language="java"
            xmlns:xsp="http://apache.org/xsp"
            xmlns:xscript="http://apache.org/xsp/xscript/1.0"
    xmlns:xalan="http://xml.apache.org/xalan"
    xmlns:saxon="http://icl.com/saxon"
            >
    <page>
      <title>XScript tests</title>
  
      <content>
        <h2>Creating Variables</h2>
  
        <h3>Create Global Scope Variable</h3>
        <xscript:variable scope="global" name="test">
          <b>This is the content of the <u>global</u> scope variable.</b>
        </xscript:variable>
        <para>
          The content of the test variable from global scope is:
          <xscript:get scope="global" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Create Page Scope Variable</h3>
        <xscript:variable scope="page" name="test">
          <b>This is the content of the <u>page</u> scope variable.</b>
        </xscript:variable>
        <para>
          The content of the test variable from page scope is:
          <xscript:get scope="page" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Create Session Scope Variable</h3>
        <xscript:variable scope="session" name="test">
          <b>This is the content of the <u>session</u> scope variable.</b>
        </xscript:variable>
        <para>
          The content of the test variable from session scope is:
          <xscript:get scope="session" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Create Request Scope Variable</h3>
        <xscript:variable scope="request" name="test">
          <b>This is the content of the <u>request</u> scope variable.</b>
        </xscript:variable>
        <para>
          The content of the test variable from request scope is:
          <xscript:get scope="request" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
  
        <h2>Transformations</h2>
  
        <h3>Transform with stylesheet variable</h3>
        <xscript:variable name="stylesheet">
          <xsl:stylesheet version="1.0"
                          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:template match="/">
              <p align="right">
                <xsl:value-of select="*"/>
                <br/>(transformed by the stylesheet)
              </p>
            </xsl:template>
          </xsl:stylesheet>
        </xscript:variable>
        <para>
          The content of the first test variable transformed with stylesheet
          variable:
          <xscript:transform name="test" stylesheet="stylesheet"/>
        </para>
  
        <h3>Copy of test variable</h3>
        <para>
          Copy of the test variable is:
          <xscript:copy-of name="test"/>
        </para>
        <para>
          Copy of the /b/u part of the test variable is:
          <xscript:copy-of name="test" select="/b/u"/>.
        </para>
  
  
        <h2>Removing Variables</h2>
  
        <h3>Remove Request Scope Variable</h3>
        <xscript:remove scope="request" name="test"/>
        <para>
          The content of the test variable from request scope is:
          <xscript:get scope="request" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Remove Session Scope Variable</h3>
        <xscript:remove scope="session" name="test"/>
        <para>
          The content of the test variable from session scope is:
          <xscript:get scope="session" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Remove Page Scope Variable</h3>
        <xscript:remove scope="page" name="test"/>
        <para>
          The content of the test variable from page scope is:
          <xscript:get scope="page" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
  
        <h3>Remove Global Scope Variable</h3>
        <xscript:remove scope="global" name="test"/>
        <para>
          The content of the test variable from global scope is:
          <xscript:get scope="global" name="test"/>.
        </para>
        <para>
          The content of the first test variable is:
          <xscript:get name="test"/>.
        </para>
      </content>
    </page>
  </xsp:page>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/stylesheets/soap-getquote1.xsl
  
  Index: soap-getquote1.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  
    Date: October 9, 2001
   -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:n="urn:xmethods-delayed-quotes"
    exclude-result-prefixes="soap n"
    >
  
    <xsl:template match="soap:Envelope">
      <b><xsl:value-of select="soap:Body/n:getQuoteResponse/Result"/></b>
    </xsl:template>
  
    <xsl:template match="@*|*|text()|processing-instruction()">
      <!-- Catch all template. Just pass along unmodified everything we
           don't handle. -->
      <xsl:copy>
        <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/xsp/samples/soap/stylesheets/soap-getquote3.xsl
  
  Index: soap-getquote3.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!--
    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.
  -->
  
  <!--
    Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  
    Date: October 9, 2001
   -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:n="urn:xmethods-delayed-quotes"
    exclude-result-prefixes="soap n"
    >
  
    <xsl:template match="/">
      <b><xsl:value-of select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/></b>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.31      +1 -7      cocoon-2.1/src/webapp/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/samples.xml,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- samples.xml	10 Mar 2004 12:58:13 -0000	1.30
  +++ samples.xml	10 Mar 2004 14:26:29 -0000	1.31
  @@ -87,12 +87,6 @@
       <sample href="components" name="Components">
         Samples of different components included with the core
       </sample> 
  -    <sample href="soap/" name="SOAP">
  -      Cocoon ships with facilities for immediate connection to SOAP resources.
  -      These examples show you how to connect to any web service with a few
  -      lines of XML markup using SOAP XSP Logicsheet. See also axis block that
  -      integrates Axis into Cocoon. 
  -    </sample> 
       <sample href="text-wrap/" name="Text wrap">
         Addresses the problem of wrapping long lines of text in source elements.
       </sample>