home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / test.xsp < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.2 KB  |  167 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!--
  19.   Author: Vadim Gritsenko "vgritsenko@apache.org"
  20.   CVS $Id: test.xsp,v 1.2 2004/04/05 12:25:33 antonio Exp $
  21.  -->
  22.  
  23. <xsp:page language="java"
  24.           xmlns:xsp="http://apache.org/xsp"
  25.           xmlns:xscript="http://apache.org/xsp/xscript/1.0"
  26.   xmlns:xalan="http://xml.apache.org/xalan"
  27.   xmlns:saxon="http://icl.com/saxon"
  28.           >
  29.   <page>
  30.     <title>XScript tests</title>
  31.  
  32.     <content>
  33.       <h2>Creating Variables</h2>
  34.  
  35.       <h3>Create Global Scope Variable</h3>
  36.       <xscript:variable scope="global" name="test">
  37.         <b>This is the content of the <u>global</u> scope variable.</b>
  38.       </xscript:variable>
  39.       <para>
  40.         The content of the test variable from global scope is:
  41.         <xscript:get scope="global" name="test"/>.
  42.       </para>
  43.       <para>
  44.         The content of the first test variable is:
  45.         <xscript:get name="test"/>.
  46.       </para>
  47.  
  48.       <h3>Create Page Scope Variable</h3>
  49.       <xscript:variable scope="page" name="test">
  50.         <b>This is the content of the <u>page</u> scope variable.</b>
  51.       </xscript:variable>
  52.       <para>
  53.         The content of the test variable from page scope is:
  54.         <xscript:get scope="page" name="test"/>.
  55.       </para>
  56.       <para>
  57.         The content of the first test variable is:
  58.         <xscript:get name="test"/>.
  59.       </para>
  60.  
  61.       <h3>Create Session Scope Variable</h3>
  62.       <xscript:variable scope="session" name="test">
  63.         <b>This is the content of the <u>session</u> scope variable.</b>
  64.       </xscript:variable>
  65.       <para>
  66.         The content of the test variable from session scope is:
  67.         <xscript:get scope="session" name="test"/>.
  68.       </para>
  69.       <para>
  70.         The content of the first test variable is:
  71.         <xscript:get name="test"/>.
  72.       </para>
  73.  
  74.       <h3>Create Request Scope Variable</h3>
  75.       <xscript:variable scope="request" name="test">
  76.         <b>This is the content of the <u>request</u> scope variable.</b>
  77.       </xscript:variable>
  78.       <para>
  79.         The content of the test variable from request scope is:
  80.         <xscript:get scope="request" name="test"/>.
  81.       </para>
  82.       <para>
  83.         The content of the first test variable is:
  84.         <xscript:get name="test"/>.
  85.       </para>
  86.  
  87.  
  88.       <h2>Transformations</h2>
  89.  
  90.       <h3>Transform with stylesheet variable</h3>
  91.       <xscript:variable name="stylesheet">
  92.         <xsl:stylesheet version="1.0"
  93.                         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  94.           <xsl:template match="/">
  95.             <p align="right">
  96.               <xsl:value-of select="*"/>
  97.               <br/>(transformed by the stylesheet)
  98.             </p>
  99.           </xsl:template>
  100.         </xsl:stylesheet>
  101.       </xscript:variable>
  102.       <para>
  103.         The content of the first test variable transformed with stylesheet
  104.         variable:
  105.         <xscript:transform name="test" stylesheet="stylesheet"/>
  106.       </para>
  107.  
  108.       <h3>Copy of test variable</h3>
  109.       <para>
  110.         Copy of the test variable is:
  111.         <xscript:copy-of name="test"/>
  112.       </para>
  113.       <para>
  114.         Copy of the /b/u part of the test variable is:
  115.         <xscript:copy-of name="test" select="/b/u"/>.
  116.       </para>
  117.  
  118.  
  119.       <h2>Removing Variables</h2>
  120.  
  121.       <h3>Remove Request Scope Variable</h3>
  122.       <xscript:remove scope="request" name="test"/>
  123.       <para>
  124.         The content of the test variable from request scope is:
  125.         <xscript:get scope="request" name="test"/>.
  126.       </para>
  127.       <para>
  128.         The content of the first test variable is:
  129.         <xscript:get name="test"/>.
  130.       </para>
  131.  
  132.       <h3>Remove Session Scope Variable</h3>
  133.       <xscript:remove scope="session" name="test"/>
  134.       <para>
  135.         The content of the test variable from session scope is:
  136.         <xscript:get scope="session" name="test"/>.
  137.       </para>
  138.       <para>
  139.         The content of the first test variable is:
  140.         <xscript:get name="test"/>.
  141.       </para>
  142.  
  143.       <h3>Remove Page Scope Variable</h3>
  144.       <xscript:remove scope="page" name="test"/>
  145.       <para>
  146.         The content of the test variable from page scope is:
  147.         <xscript:get scope="page" name="test"/>.
  148.       </para>
  149.       <para>
  150.         The content of the first test variable is:
  151.         <xscript:get name="test"/>.
  152.       </para>
  153.  
  154.       <h3>Remove Global Scope Variable</h3>
  155.       <xscript:remove scope="global" name="test"/>
  156.       <para>
  157.         The content of the test variable from global scope is:
  158.         <xscript:get scope="global" name="test"/>.
  159.       </para>
  160.       <para>
  161.         The content of the first test variable is:
  162.         <xscript:get name="test"/>.
  163.       </para>
  164.     </content>
  165.   </page>
  166. </xsp:page>
  167.