| <?xml version="1.0" encoding="ISO-8859-1"?> |
| |
| <!-- |
| Author: Vadim Gritsenko "vgritsenko@apache.org" |
| CVS $Id: test.xsp,v 1.2 2003/05/07 04:57:14 vgritsenko 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> |