stephan 2003/01/31 11:20:05
Modified: src/webapp/samples samples.xml
Added: src/blocks/chaperon/samples sitemap.xmap
src/blocks/chaperon/samples/grammars java.rgrm mathexp.grm
rgrm.grm wiki.grm wiki.rgrm
src/blocks/chaperon/samples/misc java.css matex.xsp
mathexp.xsp samples.xml test1.java test2.java
wiki.xsp
src/blocks/chaperon/samples/stylesheets java2html.xsl
mathexp2html.xsl parsefragment.xsl rgrm2grm.xsl
wiki2html.xsl
src/blocks/jsp/conf jsp.xsamples
src/blocks/jsp/samples hello.jsp simple-page2html.xsl
sitemap.xmap welcome.jsp
src/blocks/profiler/samples page2html.xsl profile2html.xsl
profile2page.xsl samples.xml sitemap.xmap test.xml
test2page.xsl xml2html.css xml2html.js xml2html.xsl
Removed: src/blocks/jsp/samples notyet.txt
src/webapp/samples/chaperon sitemap.xmap
src/webapp/samples/chaperon/grammars java.rgrm mathexp.grm
rgrm.grm wiki.grm wiki.rgrm
src/webapp/samples/chaperon/misc java.css matex.xsp
mathexp.xsp samples.xml test1.java test2.java
wiki.xsp
src/webapp/samples/chaperon/stylesheets java2html.xsl
mathexp2html.xsl parsefragment.xsl rgrm2grm.xsl
wiki2html.xsl
src/webapp/samples/jsp hello.jsp simple-page2html.xsl
sitemap.xmap welcome.jsp
src/webapp/samples/profiler page2html.xsl profile2html.xsl
profile2page.xsl samples.xml sitemap.xmap test.xml
test2page.xsl xml2html.css xml2html.js xml2html.xsl
Log:
Some cleanup of the samples.
Moved samples for jsp, profiler, chaperon
into the blocks.
Revision Changes Path
1.1 xml-cocoon2/src/blocks/chaperon/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components ================================
-->
<map:components>
<!-- =========================== Generators =================================
-->
<map:generators default="file">
<map:generator label="content,data" logger="sitemap.generator.file"
name="file"
src="org.apache.cocoon.generation.FileGenerator"/>
<map:generator name="serverpages" logger="sitemap.generator.serverpages"
label="content,data"
src="org.apache.cocoon.generation.ServerPagesGenerator"/>
<map:generator name="textparser" label="content,data"
src="org.apache.cocoon.generation.TextParserGenerator"
logger="sitemap.generator.textparser"/>
</map:generators>
<!-- =========================== Transformers
================================= -->
<map:transformers default="xslt">
<map:transformer logger="sitemap.transformer.xslt" name="xslt"
src="org.apache.cocoon.transformation.TraxTransformer">
<use-request-parameters>true</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
</map:transformer>
<map:transformer name="textparser"
src="org.apache.cocoon.transformation.TextFragmentParserTransformer"
logger="sitemap.transformer.textparser"/>
</map:transformers>
<!-- =========================== Readers ================================= -->
<map:readers default="resource">
<map:reader logger="sitemap.reader.resource" name="resource"
src="org.apache.cocoon.reading.ResourceReader"/>
</map:readers>
<!-- =========================== Serializers
================================= -->
<map:serializers default="html">
<map:serializer logger="sitemap.serializer.xml" mime-type="text/xml"
name="xml"
src="org.apache.cocoon.serialization.XMLSerializer"/>
<map:serializer logger="sitemap.serializer.html" mime-type="text/html"
name="html"
src="org.apache.cocoon.serialization.HTMLSerializer">
<buffer-size>1024</buffer-size>
</map:serializer>
</map:serializers>
<!-- =========================== Matchers =================================
-->
<map:matchers default="wildcard">
<map:matcher logger="sitemap.matcher.wildcard" name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>
<!-- ====================== Pipelines defintions
============================= -->
<map:pipes default="caching">
<map:pipe name="caching"
src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
<map:pipe name="noncaching"
src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>
</map:pipes>
</map:components>
<!-- =========================== Pipelines =================================
-->
<map:pipelines>
<map:pipeline internal-only="true">
<!-- IMPORTANT! This pipeline sould be cachable -->
<map:match pattern="*.grm">
<map:generate type="textparser" src="grammars/{1}.rgrm">
<map:parameter name="grammar"
value="context://samples/chaperon/grammars/rgrm.grm"/>
</map:generate>
<map:transform src="stylesheets/rgrm2grm.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="welcome"/>
</map:match>
<map:match pattern="welcome">
<map:generate src="misc/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="images/*">
<map:redirect-to uri="../../images/{1}"/>
</map:match>
<!-- ========================= Chaperon ================================
-->
<map:match pattern="mathexp.html">
<map:generate type="serverpages" src="misc/mathexp.xsp"/>
<map:transform src="stylesheets/parsefragment.xsl">
<map:parameter name="parse_element" value="math"/>
</map:transform>
<map:transform type="textparser">
<map:parameter name="grammar"
value="context://samples/chaperon/grammars/mathexp.grm"/>
</map:transform>
<map:transform src="stylesheets/mathexp2html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="wiki.html">
<map:generate type="serverpages" src="misc/wiki.xsp"/>
<map:transform type="textparser">
<!--<map:parameter name="grammar" value="cocoon:/wiki.grm"/>-->
<map:parameter name="grammar"
value="context://samples/chaperon/grammars/wiki.grm"/>
</map:transform>
<map:transform src="stylesheets/wiki2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="java1.html">
<map:generate type="textparser" src="misc/test1.java">
<map:parameter name="grammar" value="cocoon:/java.grm"/>
<!--<map:parameter name="grammar" value="context:/grammars/java.grm"/>-->
<map:parameter name="includeignorabletokens" value="true"/>
</map:generate>
<map:transform src="stylesheets/java2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="java2.html">
<map:generate type="textparser" src="misc/test2.java">
<map:parameter name="grammar" value="cocoon:/java.grm"/>
<!--<map:parameter name="grammar" value="context:/grammars/java.grm"/>-->
<map:parameter name="includeignorabletokens" value="true"/>
</map:generate>
<map:transform src="stylesheets/java2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="java.css">
<map:read src="misc/java.css"/>
</map:match>
<!-- ========================= Server ================================ -->
<map:handle-errors>
<map:transform src="context://stylesheets/system/error2html.xsl"/>
<map:serialize status-code="500"/>
</map:handle-errors>
</map:pipeline>
</map:pipelines>
</map:sitemap>
1.1
xml-cocoon2/src/blocks/chaperon/samples/grammars/java.rgrm
Index: java.rgrm
===================================================================
/*------------------------------------------------------------------
* Copyright (C)
* 1996, 1997, 1998 Dmitri Bronnikov, All rights reserved.
*
* THIS GRAMMAR IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGMENT.
*
* [EMAIL PROTECTED]
*
*------------------------------------------------------------------
*
* VERSION 1.06 DATE 20 AUG 1998
*
*------------------------------------------------------------------
*
* UPDATES
*
* 1.06 Correction of Java 1.1 syntax
* 1.05 Yet more Java 1.1
* <qualified name>.<allocation expression>
* 1.04 More Java 1.1 features:
* <class name>.this
* <type name>.class
* 1.03 Added Java 1.1 features:
* inner classes,
* anonymous classes,
* non-static initializer blocks,
* array initialization by new operator
* 1.02 Corrected cast expression syntax
* 1.01 All shift/reduce conflicts, except dangling else, resolved
*
*------------------------------------------------------------------
*
* PARSING CONFLICTS RESOLVED
*
* Some Shift/Reduce conflicts have been resolved at the expense of
* the grammar defines a superset of the language. The following
* actions have to be performed to complete program syntax checking:
*
* 1) Check that modifiers applied to a class, interface, field,
* or constructor are allowed in respectively a class, inteface,
* field or constructor declaration. For example, a class
* declaration should not allow other modifiers than abstract,
* final and public.
*
* 2) For an expression statement, check it is either increment, or
* decrement, or assignment expression.
*
* 3) Check that type expression in a cast operator indicates a type.
* Some of the compilers that I have tested will allow simultaneous
* use of identically named type and variable in the same scope
* depending on context.
*
* 4) Change lexical definition to change '[' optionally followed by
* any number of white-space characters immediately followed by ']'
* to OP_DIM token. I defined this token as [\[]{white_space}*[\]]
* in the lexer.
*
*------------------------------------------------------------------
*
* UNRESOLVED SHIFT/REDUCE CONFLICTS
*
* Dangling else in if-then-else
*
*------------------------------------------------------------------
*/
%uri "http://chaperon.sourceforge.net/grammar/java/1.0";
%token DOPEN \(;
%token DCLOSE \);
%token COPEN \{;
%token CCLOSE \};
%token BOPEN \[;
%token BCLOSE \];
%token SEMICOLON \;;
%token COMMA \,;
%token DOT \.;
%token OP_EQ ==;
%token OP_LE \<=;
%token OP_GE \>=;
%token OP_NE !=;
%token OP_LOR \|\|;
%token OP_LAND &&;
%token OP_INC \+\+;
%token OP_DEC \-\-;
%token OP_SHR \>\>;
%token OP_SHL \<\<;
%token OP_SHRR \>\>\>;
%token ASS_OP \+= | \-= | \*= | /= | &= | \|= | \^= | \%= | \<\<= | \>\>= |
\>\>\>=;
%token EQ \=;
%token GT \>;
%token LT \<;
%token NOT \!;
%token TILDE \~;
%token QM \?;
%token COLON \:;
%token PLUS \+;
%token MINUS \-;
%token MULT \*;
%token DIV \/;
%token AND \&;
%token OR \|;
%token XOR \^;
%token MOD \%;
%token BOOLLIT true|false;
%token ABSTRACT abstract;
%token DO do;
%token IMPLEMENTS implements;
%token PACKAGE package;
%token THROW throw;
%token BOOLEAN boolean;
%token DOUBLE double;
%token IMPORT import;
%token PRIVATE private;
%token THROWS throws;
%token BREAK break;
%right ELSE else;
%token INNER inner;
%token PROTECTED protected;
%token TRANSIENT transient;
%token BYTE byte;
%token EXTENDS extends;
%token INSTANCEOF instanceof;
%token PUBLIC public;
%token TRY try;
%token CASE case;
%token FINAL final;
%token INT int;
%token REST rest;
%token VAR var;
%token CAST cast;
%token FINALLY finally;
%token INTERFACE interface;
%token RETURN return;
%token VOID void;
%token CATCH catch;
%token FLOAT float;
%token LONG long;
%token SHORT short;
%token VOLATILE volatile;
%token CHAR char;
%token FOR for;
%token NATIVE native;
%token STATIC static;
%token WHILE while;
%token CLASS class;
%token FUTURE future;
%token NEW new;
%token SUPER super;
%token CONST const;
%token GENERIC generic;
%token NULL null;
%token SWITCH switch;
%token CONTINUE continue;
%token GOTO goto;
%token OPERATOR operator;
%token SYNCHRONIZED synchronized;
%token DEFAULT default;
%token IF if;
%token OUTER outer;
%token THIS this;
%ab HexDigit [0-9a-fA-F];
%ab Digit [0-9];
%ab OctalDigit [0-7];
%ab TetraDigit [0-3];
%ab NonZeroDigit [1-9];
%ab Letter [a-zA-Z_];
%ab AnyButSlash [^\/];
%ab AnyButAstr [^\*];
%ab UniEsc [\1b];
%ab OctEscape1 \\ <OctalDigit>;
%ab OctEscape2 \\ <OctalDigit><OctalDigit>;
%ab OctEscape3 \\ <TetraDigit><OctalDigit><OctalDigit>;
%ab OctEscape (<OctEscape1>|<OctEscape2>|<OctEscape3>);
%ab Escape [\\]([rnbft\\\'\"]);
%ab ULetter (<Letter>|<UniEsc>);
%ab Identifier <ULetter>(<ULetter>|<Digit>)*;
%ab IntSuffix (l|L);
%ab DecimalNum <NonZeroDigit><Digit>*<IntSuffix>?;
%ab OctalNum 0 <OctalDigit>*<IntSuffix>?;
%ab HexNum 0 (x|X) <HexDigit><HexDigit>*<IntSuffix>?;
%ab IntegerLiteral (<DecimalNum>|<OctalNum>|<HexNum>);
%ab Sign (\+ | \-);
%ab FlSuffix (f|F|d|D);
%ab SignedInt <Sign>?<Digit>+;
%ab Expo (e|E);
%ab ExponentPart <Expo><SignedInt>?;
%ab Float1 <Digit>+ \. (<Digit>+)?<ExponentPart>?<FlSuffix>?;
%ab Float2 \. <Digit>+<ExponentPart>?<FlSuffix>?;
%ab Float3 <Digit>+<ExponentPart><FlSuffix>?;
%ab Float4 <Digit>+<FlSuffix>;
%ab FloatingPoint (<Float1>|<Float2>|<Float3>|<Float4>);
%ab AnyChrChr [^\\'];
%ab AnyStrChr [^\\\"];
%ab Character \' (<Escape>|<OctEscape>|<AnyChrChr>) \' ;
%ab String \" (<Escape>|<OctEscape>|<AnyStrChr>)* \" ;
%ab Numeric (<IntegerLiteral>|<FloatingPoint>);
%token LITERAL (<Numeric>|<Character>|<String>);
%token IDENTIFIER ([a-zA-Z_]|[\1b])(([a-zA-Z_]|[\1b])|[0-9])*;
//%token OP_DIM \[ ([\r\n\f\t\b\ ]|( \/ \* ([^\*]| \* [^\/])* \* \/ |
// \/ \/ (.*)))* \] ;
//%whitespace [\r\n\f\t\b\ ];
%token OP_DIM \[ ([\r\n\t\ ]|( \/ \* ([^\*]| \* [^\/])* \* \/ |
\/ \/ (.*)))* \] ;
%ignore whitespace [\t\ ];
%ignore eol \r(\n)?|\n;
%ab Comment1 \/ \* (<AnyButAstr>|[\*]<AnyButSlash>)* \* \/;
%ab Comment2 \/ \/ (.*);
%ignore comment (<Comment1>|<Comment2>);
%start CompilationUnit;
%%
TypeSpecifier
: TypeName
| TypeName Dims
;
TypeName
: PrimitiveType
| QualifiedName
;
ClassNameList
: QualifiedName
| ClassNameList COMMA QualifiedName
;
PrimitiveType
: BOOLEAN
| CHAR
| BYTE
| SHORT
| INT
| LONG
| FLOAT
| DOUBLE
| VOID
;
SemiColons
: SEMICOLON
| SemiColons SEMICOLON
;
CompilationUnit
: ProgramFile
;
ProgramFile
: PackageStatement ImportStatements TypeDeclarations
| PackageStatement ImportStatements
| PackageStatement TypeDeclarations
| ImportStatements TypeDeclarations
| PackageStatement
| ImportStatements
| TypeDeclarations
;
PackageStatement
: PACKAGE QualifiedName SemiColons
;
TypeDeclarations
: TypeDeclarationOptSemi
| TypeDeclarations TypeDeclarationOptSemi
;
TypeDeclarationOptSemi
: TypeDeclaration
| TypeDeclaration SemiColons
;
ImportStatements
: ImportStatement
| ImportStatements ImportStatement
;
ImportStatement
: IMPORT QualifiedName SemiColons
| IMPORT QualifiedName DOT MULT SemiColons
;
QualifiedName
: IDENTIFIER %append
| QualifiedName DOT IDENTIFIER %append
;
TypeDeclaration
: ClassHeader COPEN FieldDeclarations CCLOSE
| ClassHeader COPEN CCLOSE
;
ClassHeader
: Modifiers ClassWord IDENTIFIER Extends Interfaces
| Modifiers ClassWord IDENTIFIER Extends
| Modifiers ClassWord IDENTIFIER Interfaces
| ClassWord IDENTIFIER Extends Interfaces
| Modifiers ClassWord IDENTIFIER
| ClassWord IDENTIFIER Extends
| ClassWord IDENTIFIER Interfaces
| ClassWord IDENTIFIER
;
Modifiers
: Modifier %append
| Modifiers Modifier %append
;
Modifier
: ABSTRACT
| FINAL
| PUBLIC
| PROTECTED
| PRIVATE
| STATIC
| TRANSIENT
| VOLATILE
| NATIVE
| SYNCHRONIZED
;
ClassWord
: CLASS
| INTERFACE
;
Interfaces
: IMPLEMENTS ClassNameList
;
FieldDeclarations
: FieldDeclarationOptSemi
| FieldDeclarations FieldDeclarationOptSemi
;
FieldDeclarationOptSemi
: FieldDeclaration
| FieldDeclaration SemiColons
;
FieldDeclaration
: FieldVariableDeclaration SEMICOLON
| MethodDeclaration
| ConstructorDeclaration
| StaticInitializer
| NonStaticInitializer
| TypeDeclaration
;
FieldVariableDeclaration
: Modifiers TypeSpecifier VariableDeclarators
| TypeSpecifier VariableDeclarators
;
VariableDeclarators
: VariableDeclarator
| VariableDeclarators COMMA VariableDeclarator
;
VariableDeclarator
: DeclaratorName
| DeclaratorName EQ VariableInitializer
;
VariableInitializer
: Expression
| COPEN CCLOSE
| COPEN ArrayInitializers CCLOSE
;
ArrayInitializers
: VariableInitializer
| ArrayInitializers COMMA VariableInitializer
| ArrayInitializers COMMA
;
MethodDeclaration
: Modifiers TypeSpecifier MethodDeclarator Throws MethodBody
| Modifiers TypeSpecifier MethodDeclarator MethodBody
| TypeSpecifier MethodDeclarator Throws MethodBody
| TypeSpecifier MethodDeclarator MethodBody
;
MethodDeclarator
: DeclaratorName DOPEN ParameterList DCLOSE
| DeclaratorName DOPEN DCLOSE
| MethodDeclarator OP_DIM
;
ParameterList
: Parameter
| ParameterList COMMA Parameter
;
Parameter
: TypeSpecifier DeclaratorName
| FINAL TypeSpecifier DeclaratorName
;
DeclaratorName
: IDENTIFIER
| DeclaratorName OP_DIM
;
Throws
: THROWS ClassNameList
;
MethodBody
: Block
| SEMICOLON
;
ConstructorDeclaration
: Modifiers ConstructorDeclarator Throws Block
| Modifiers ConstructorDeclarator Block
| ConstructorDeclarator Throws Block
| ConstructorDeclarator Block
;
ConstructorDeclarator
: IDENTIFIER DOPEN ParameterList DCLOSE
| IDENTIFIER DOPEN DCLOSE
;
StaticInitializer
: STATIC Block
;
NonStaticInitializer
: Block
;
Extends
: EXTENDS TypeName
| Extends COMMA TypeName
;
Block
: COPEN LocalVariableDeclarationsAndStatements CCLOSE
| COPEN CCLOSE
;
LocalVariableDeclarationsAndStatements
: LocalVariableDeclarationOrStatement %append
| LocalVariableDeclarationsAndStatements
LocalVariableDeclarationOrStatement %append
;
LocalVariableDeclarationOrStatement
: LocalVariableDeclarationStatement
| Statement
;
LocalVariableDeclarationStatement
: TypeSpecifier VariableDeclarators SEMICOLON
| FINAL TypeSpecifier VariableDeclarators SEMICOLON
;
Statement
: EmptyStatement
| LabelStatement
| ExpressionStatement SEMICOLON
| SelectionStatement
| IterationStatement
| JumpStatement
| GuardingStatement
| Block
;
EmptyStatement
: SEMICOLON
;
LabelStatement
: IDENTIFIER COLON
| CASE ConstantExpression COLON
| DEFAULT COLON
;
ExpressionStatement
: Expression
;
SelectionStatement
: IF DOPEN Expression DCLOSE Statement %prec ELSE
| IF DOPEN Expression DCLOSE Statement ELSE Statement %prec ELSE
| SWITCH DOPEN Expression DCLOSE Block
;
IterationStatement
: WHILE DOPEN Expression DCLOSE Statement
| DO Statement WHILE DOPEN Expression DCLOSE SEMICOLON
| FOR DOPEN ForInit ForExpr ForIncr DCLOSE Statement
| FOR DOPEN ForInit ForExpr DCLOSE Statement
;
ForInit
: ExpressionStatements SEMICOLON
| LocalVariableDeclarationStatement
| SEMICOLON
;
ForExpr
: Expression SEMICOLON
| SEMICOLON
;
ForIncr
: ExpressionStatements
;
ExpressionStatements
: ExpressionStatement %resolve
| ExpressionStatements COMMA ExpressionStatement
;
JumpStatement
: BREAK IDENTIFIER SEMICOLON
| BREAK SEMICOLON
| CONTINUE IDENTIFIER SEMICOLON
| CONTINUE SEMICOLON
| RETURN Expression SEMICOLON
| RETURN SEMICOLON
| THROW Expression SEMICOLON
;
GuardingStatement
: SYNCHRONIZED DOPEN Expression DCLOSE Statement
| TRY Block Finally
| TRY Block Catches
| TRY Block Catches Finally
;
Catches
: Catch
| Catches Catch
;
Catch
: CatchHeader Block
;
CatchHeader
: CATCH DOPEN TypeSpecifier IDENTIFIER DCLOSE
| CATCH DOPEN TypeSpecifier DCLOSE
;
Finally
: FINALLY Block
;
PrimaryExpression
: QualifiedName %resolve
| NotJustName %resolve
;
NotJustName
: SpecialName %resolve
| NewAllocationExpression %resolve
| ComplexPrimary %resolve
;
ComplexPrimary
: DOPEN Expression DCLOSE
| ComplexPrimaryNoParenthesis %resolve
;
ComplexPrimaryNoParenthesis
: LITERAL
| BOOLLIT
| ArrayAccess
| FieldAccess
| MethodCall
;
ArrayAccess
: QualifiedName BOPEN Expression BCLOSE
| ComplexPrimary BOPEN Expression BCLOSE
;
FieldAccess
: NotJustName DOT IDENTIFIER
| RealPostfixExpression DOT IDENTIFIER
| QualifiedName DOT THIS
| QualifiedName DOT CLASS
| PrimitiveType DOT CLASS
;
MethodCall
: MethodAccess DOPEN ArgumentList DCLOSE
| MethodAccess DOPEN DCLOSE
;
MethodAccess
: ComplexPrimaryNoParenthesis
| SpecialName
| QualifiedName
;
SpecialName
: THIS
| SUPER
| NULL
;
ArgumentList
: Expression
| ArgumentList COMMA Expression
;
NewAllocationExpression
: PlainNewAllocationExpression
| QualifiedName DOT PlainNewAllocationExpression
;
PlainNewAllocationExpression
: ArrayAllocationExpression
| ClassAllocationExpression
| ArrayAllocationExpression COPEN CCLOSE
| ClassAllocationExpression COPEN CCLOSE
| ArrayAllocationExpression COPEN ArrayInitializers CCLOSE
| ClassAllocationExpression COPEN FieldDeclarations CCLOSE
;
ClassAllocationExpression
: NEW TypeName DOPEN ArgumentList DCLOSE
| NEW TypeName DOPEN DCLOSE
;
ArrayAllocationExpression
: NEW TypeName DimExprs Dims
| NEW TypeName DimExprs
| NEW TypeName Dims
;
DimExprs
: DimExpr
| DimExprs DimExpr
;
DimExpr
: BOPEN Expression BCLOSE
;
Dims
: OP_DIM
| Dims OP_DIM
;
PostfixExpression
: PrimaryExpression %resolve
| RealPostfixExpression %resolve
;
RealPostfixExpression
: PostfixExpression OP_INC
| PostfixExpression OP_DEC
;
UnaryExpression
: OP_INC UnaryExpression
| OP_DEC UnaryExpression
| ArithmeticUnaryOperator CastExpression
| LogicalUnaryExpression %resolve
;
LogicalUnaryExpression
: PostfixExpression %resolve
| LogicalUnaryOperator UnaryExpression
;
LogicalUnaryOperator
: TILDE
| NOT
;
ArithmeticUnaryOperator
: PLUS
| MINUS
;
CastExpression
: UnaryExpression %resolve
| DOPEN PrimitiveTypeExpression DCLOSE CastExpression
| DOPEN ClassTypeExpression DCLOSE CastExpression
| DOPEN Expression DCLOSE LogicalUnaryExpression
;
PrimitiveTypeExpression
: PrimitiveType
| PrimitiveType Dims
;
ClassTypeExpression
: QualifiedName Dims
;
MultiplicativeExpression
: CastExpression %resolve
| MultiplicativeExpression MULT CastExpression
| MultiplicativeExpression DIV CastExpression
| MultiplicativeExpression MOD CastExpression
;
AdditiveExpression
: MultiplicativeExpression %resolve
| AdditiveExpression PLUS MultiplicativeExpression
| AdditiveExpression MINUS MultiplicativeExpression
;
ShiftExpression
: AdditiveExpression %resolve
| ShiftExpression OP_SHL AdditiveExpression
| ShiftExpression OP_SHR AdditiveExpression
| ShiftExpression OP_SHRR AdditiveExpression
;
RelationalExpression
: ShiftExpression %resolve
| RelationalExpression LT ShiftExpression
| RelationalExpression GT ShiftExpression
| RelationalExpression OP_LE ShiftExpression
| RelationalExpression OP_GE ShiftExpression
| RelationalExpression INSTANCEOF TypeSpecifier
;
EqualityExpression
: RelationalExpression %resolve
| EqualityExpression OP_EQ RelationalExpression
| EqualityExpression OP_NE RelationalExpression
;
AndExpression
: EqualityExpression %resolve
| AndExpression AND EqualityExpression
;
ExclusiveOrExpression
: AndExpression %resolve
| ExclusiveOrExpression XOR AndExpression
;
InclusiveOrExpression
: ExclusiveOrExpression %resolve
| InclusiveOrExpression OR ExclusiveOrExpression
;
ConditionalAndExpression
: InclusiveOrExpression %resolve
| ConditionalAndExpression OP_LAND InclusiveOrExpression
;
ConditionalOrExpression
: ConditionalAndExpression %resolve
| ConditionalOrExpression OP_LOR ConditionalAndExpression
;
ConditionalExpression
: ConditionalOrExpression %resolve
| ConditionalOrExpression QM Expression COLON ConditionalExpression
;
AssignmentExpression
: ConditionalExpression %resolve
| UnaryExpression AssignmentOperator AssignmentExpression
;
AssignmentOperator
: EQ
| ASS_OP
;
Expression
: AssignmentExpression
;
ConstantExpression
: ConditionalExpression
;
1.1
xml-cocoon2/src/blocks/chaperon/samples/grammars/mathexp.grm
Index: mathexp.grm
===================================================================
<?xml version="1.0"?>
<!--<!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 1.0//EN"
"grammar.dtd">-->
<grammar uri="http://chaperon.sourceforge.net/grammar/mathexp/1.0">
<tokens>
<token tsymbol="plus">
<cc><cs content="+-"/></cc>
</token>
<token tsymbol="mult">
<cc><cs content="*/"/></cc>
</token>
<token tsymbol="dopen">
<string content="("/>
</token>
<token tsymbol="dclose">
<string content=")"/>
</token>
<token tsymbol="id">
<concat>
<cc><ci min="A" max="Z"/><ci min="a" max="z"/></cc>
<cc minOccurs="0" maxOccurs="*"><ci min="A" max="Z"/><ci min="a"
max="z"/><ci min="0" max="9"/><cs content="_"/></cc>
</concat>
</token>
<token tsymbol="number">
<alt>
<concat>
<cc minOccurs="1" maxOccurs="*"><ci min="0" max="9"/></cc>
<concat minOccurs="0" maxOccurs="1">
<string content="."/>
<cc minOccurs="0" maxOccurs="*"><ci min="0" max="9"/></cc>
</concat>
</concat>
<concat>
<string content="."/>
<cc minOccurs="1" maxOccurs="*"><ci min="0" max="9"/></cc>
</concat>
</alt>
</token>
</tokens>
<ignorabletokens>
<token tsymbol="whitespace">
<cc maxOccurs="*"><cs content=" 	 "/></cc>
</token>
</ignorabletokens>
<productions>
<production ntsymbol="E">
<ntsymbol name="E"/><tsymbol name="plus"/><ntsymbol name="T"/>
</production>
<production ntsymbol="E">
<ntsymbol name="T"/>
</production>
<production ntsymbol="T">
<ntsymbol name="T"/><tsymbol name="mult"/><ntsymbol name="F"/>
</production>
<production ntsymbol="T">
<ntsymbol name="F"/>
</production>
<production ntsymbol="F">
<tsymbol name="dopen"/><ntsymbol name="E"/><tsymbol name="dclose"/>
</production>
<production ntsymbol="F">
<tsymbol name="id"/>
</production>
<production ntsymbol="F">
<tsymbol name="number"/>
</production>
</productions>
<ssymbol ntsymbol="E"/>
</grammar>
1.1 xml-cocoon2/src/blocks/chaperon/samples/grammars/rgrm.grm
Index: rgrm.grm
===================================================================
<?xml version="1.0" standalone="no"?>
<!--<!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 1.0//EN"
"grammar.dtd">-->
<grammar uri="http://chaperon.sourceforge.net/grammar/rgrm/1.0">
<tokens>
<token tsymbol="token_decl">
<alt>
<string content="%token"/>
<string content="%left"/>
<string content="%right"/>
</alt>
</token>
<token tsymbol="ab_decl">
<string content="%ab"/>
</token>
<token tsymbol="start_decl">
<string content="%start"/>
</token>
<token tsymbol="ignorabletoken_decl">
<string content="%ignore"/>
</token>
<token tsymbol="reducetype_decl">
<alt>
<string content="%normal"/>
<string content="%append"/>
<string content="%resolve"/>
<string content="%neglect"/>
</alt>
</token>
<token tsymbol="prec_decl">
<string content="%prec"/>
</token>
<token tsymbol="uri_decl">
<string content="%uri"/>
</token>
<token tsymbol="delimiter">
<string content="%%"/>
</token>
<token tsymbol="colon">
<string content=":"/>
</token>
<token tsymbol="alt">
<string content="|"/>
</token>
<token tsymbol="semicolon">
<string content=";"/>
</token>
<token tsymbol="comma">
<string content=","/>
</token>
<token tsymbol="number">
<cc minOccurs="1" maxOccurs="*"><ci min="0" max="9"/></cc>
</token>
<token tsymbol="copen">
<string content="{"/>
</token>
<token tsymbol="cclose">
<string content="}"/>
</token>
<token tsymbol="abopen">
<string content="<"/>
</token>
<token tsymbol="abclose">
<string content=">"/>
</token>
<token tsymbol="string">
<concat>
<string content="""/>
<alt minOccurs="1" maxOccurs="*">
<ncc><cs content="\""/></ncc>
<concat><string content="\"/><ncc><cs content="u"/></ncc></concat>
<concat>
<string content="\u"/>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
</concat>
</alt>
<string content="""/>
</concat>
</token>
<token tsymbol="id">
<concat>
<cc><ci min="A" max="Z"/><ci min="a" max="z"/></cc>
<cc minOccurs="0" maxOccurs="*">
<ci min="A" max="Z"/><ci min="a" max="z"/><ci min="0" max="9"/><cs
content="_"/>
</cc>
</concat>
</token>
<token tsymbol="character">
<!--<alt>-->
<ncc><cs content="\[]-  ();%[]|+?*^$<>""/></ncc>
<!--<concat><string content="\"/><dot/></concat>
<concat><string content="\"/><ncc><cs content="u"/></ncc></concat>
<concat>
<string content="\u"/>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
<cc><ci min="0" max="9"/><ci min="a" max="f"/><ci min="A" max="F"/></cc>
</concat>
</alt>-->
</token>
<token tsymbol="maskedcharacter">
<concat><string content="\"/><dot/></concat>
</token>
<token tsymbol="minus">
<string content="-"/>
</token>
<token tsymbol="hat">
<string content="^"/>
</token>
<token tsymbol="dollar">
<string content="$"/>
</token>
<token tsymbol="ccbegin">
<string content="["/>
</token>
<token tsymbol="ccend">
<string content="]"/>
</token>
<token tsymbol="regexdot">
<string content="."/>
</token>
<token tsymbol="dopen">
<string content="("/>
</token>
<token tsymbol="dclose">
<string content=")"/>
</token>
<token tsymbol="questionmark">
<string content="?"/>
</token>
<token tsymbol="mult">
<string content="*"/>
</token>
<token tsymbol="plus">
<string content="+"/>
</token>
</tokens>
<ignorabletokens>
<token tsymbol="comment">
<alt>
<concat><string content="//"/><ncc minOccurs="0" maxOccurs="*"><cs
content=" "/></ncc></concat>
<concat>
<string content="/*"/>
<alt minOccurs="0" maxOccurs="*">
<ncc><cs content="*"/></ncc>
<concat><string content="*"/><ncc><cs content="/"/></ncc></concat>
</alt>
<string content="*/"/>
</concat>
</alt>
</token>
<token tsymbol="whitespace">
<cc maxOccurs="*"><cs content=" 	 "/></cc>
</token>
</ignorabletokens>
<productions>
<production ntsymbol="intervall">
<tsymbol name="character"/><tsymbol name="minus"/><tsymbol
name="character"/>
</production>
<production ntsymbol="intervall">
<tsymbol name="maskedcharacter"/><tsymbol name="minus"/><tsymbol
name="character"/>
</production>
<production ntsymbol="intervall">
<tsymbol name="character"/><tsymbol name="minus"/><tsymbol
name="maskedcharacter"/>
</production>
<production ntsymbol="intervall">
<tsymbol name="maskedcharacter"/><tsymbol name="minus"/><tsymbol
name="maskedcharacter"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<ntsymbol name="sequence"/><ntsymbol name="intervall"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<ntsymbol name="sequence"/><tsymbol name="character"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<ntsymbol name="sequence"/><tsymbol name="maskedcharacter"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<ntsymbol name="intervall"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<tsymbol name="character"/>
</production>
<production ntsymbol="sequence" reducetype="resolve">
<tsymbol name="maskedcharacter"/>
</production>
<production ntsymbol="string" reducetype="append">
<ntsymbol name="string"/><tsymbol name="character"/>
</production>
<production ntsymbol="string" reducetype="append">
<ntsymbol name="string"/><tsymbol name="maskedcharacter"/>
</production>
<production ntsymbol="string" reducetype="append">
<tsymbol name="character"/>
</production>
<production ntsymbol="string" reducetype="append">
<tsymbol name="maskedcharacter"/>
</production>
<production ntsymbol="characterclass">
<tsymbol name="ccbegin"/><ntsymbol name="sequence"/><tsymbol
name="ccend"/>
</production>
<production ntsymbol="negatedcharacterclass">
<tsymbol name="ccbegin"/><tsymbol name="hat"/><ntsymbol
name="sequence"/><tsymbol name="ccend"/>
</production>
<production ntsymbol="regexdot">
<tsymbol name="regexdot"/>
</production>
<production ntsymbol="regexbol">
<tsymbol name="hat"/>
</production>
<production ntsymbol="regexeol">
<tsymbol name="dollar"/>
</production>
<production ntsymbol="regexklammer">
<tsymbol name="dopen"/><ntsymbol name="regexalternation"/><tsymbol
name="dclose"/>
</production>
<production ntsymbol="regexabref">
<tsymbol name="abopen"/><tsymbol name="id"/><tsymbol name="abclose"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="characterclass"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="negatedcharacterclass"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="regexklammer"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="string"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="regexdot"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="regexbol"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="regexeol"/>
</production>
<production ntsymbol="regexterm" reducetype="resolve">
<ntsymbol name="regexabref"/>
</production>
<production ntsymbol="regexoptional">
<ntsymbol name="regexterm"/><tsymbol name="questionmark"/>
</production>
<production ntsymbol="regexstar">
<ntsymbol name="regexterm"/><tsymbol name="mult"/>
</production>
<production ntsymbol="regexplus">
<ntsymbol name="regexterm"/><tsymbol name="plus"/>
</production>
<production ntsymbol="regexmultiplicator">
<tsymbol name="copen"/><tsymbol name="number"/><tsymbol name="cclose"/>
</production>
<production ntsymbol="regexmultiplicator">
<tsymbol name="copen"/><tsymbol name="number"/>
<tsymbol name="comma"/><tsymbol name="number"/><tsymbol name="cclose"/>
</production>
<production ntsymbol="regexvar">
<ntsymbol name="regexterm"/><ntsymbol name="regexmultiplicator"/>
</production>
<production ntsymbol="regexquantifier" reducetype="resolve">
<ntsymbol name="regexoptional"/>
</production>
<production ntsymbol="regexquantifier" reducetype="resolve">
<ntsymbol name="regexstar"/>
</production>
<production ntsymbol="regexquantifier" reducetype="resolve">
<ntsymbol name="regexplus"/>
</production>
<production ntsymbol="regexquantifier" reducetype="resolve">
<ntsymbol name="regexterm"/>
</production>
<production ntsymbol="regexquantifier" reducetype="resolve">
<ntsymbol name="regexvar"/>
</production>
<production ntsymbol="regexconcatenation" reducetype="append">
<ntsymbol name="regexconcatenation"/><ntsymbol name="regexquantifier"/>
</production>
<production ntsymbol="regexconcatenation" reducetype="resolve">
<ntsymbol name="regexquantifier"/>
</production>
<production ntsymbol="regexalternation" reducetype="append">
<ntsymbol name="regexalternation"/><tsymbol name="alt"/><ntsymbol
name="regexconcatenation"/>
</production>
<production ntsymbol="regexalternation" reducetype="resolve">
<ntsymbol name="regexconcatenation"/>
</production>
<production ntsymbol="regexexpression">
<ntsymbol name="regexalternation"/>
</production>
<production ntsymbol="grammar">
<ntsymbol name="token_decls"/><tsymbol name="delimiter"/>
<ntsymbol name="production_decls"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decls"/> <ntsymbol name="token_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decls"/><ntsymbol name="start_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="start_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decls"/><ntsymbol name="ignorabletoken_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="ignorabletoken_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decls"/><ntsymbol name="uri_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="uri_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="token_decls"/><ntsymbol name="ab_decl"/>
</production>
<production ntsymbol="token_decls" reducetype="append">
<ntsymbol name="ab_decl"/>
</production>
<production ntsymbol="token_decl">
<tsymbol name="token_decl"/><tsymbol name="id"/><ntsymbol
name="regexexpression"/><tsymbol name="semicolon"/>
</production>
<production ntsymbol="start_decl">
<tsymbol name="start_decl"/><tsymbol name="id"/><tsymbol name="semicolon"/>
</production>
<production ntsymbol="ignorabletoken_decl">
<tsymbol name="ignorabletoken_decl"/><tsymbol name="id"/><ntsymbol
name="regexexpression"/>
<tsymbol name="semicolon"/>
</production>
<production ntsymbol="uri_decl">
<tsymbol name="uri_decl"/><tsymbol name="string"/><tsymbol
name="semicolon"/>
</production>
<production ntsymbol="ab_decl">
<tsymbol name="ab_decl"/><tsymbol name="id"/><ntsymbol
name="regexexpression"/><tsymbol name="semicolon"/>
</production>
<production ntsymbol="production_decls" reducetype="append">
<ntsymbol name="production_decls"/><ntsymbol name="production_decl"/>
</production>
<production ntsymbol="production_decls" reducetype="append">
<ntsymbol name="production_decl"/>
</production>
<production ntsymbol="production_decl">
<tsymbol name="id"/><tsymbol name="colon"/><ntsymbol
name="production_defs"/><tsymbol name="semicolon"/>
</production>
<production ntsymbol="production_defs" reducetype="append">
<ntsymbol name="production_defs"/><tsymbol name="alt"/><ntsymbol
name="production_def"/>
</production>
<production ntsymbol="production_defs" reducetype="append">
<ntsymbol name="production_def"/>
</production>
<production ntsymbol="prec_decl" reducetype="append">
<tsymbol name="prec_decl"/><tsymbol name="id"/>
</production>
<production ntsymbol="production_def" reducetype="append">
<ntsymbol name="ids"/>
</production>
<production ntsymbol="production_def" reducetype="append">
<ntsymbol name="ids"/><ntsymbol name="prec_decl"/>
</production>
<production ntsymbol="production_def" reducetype="append">
<ntsymbol name="ids"/><tsymbol name="reducetype_decl"/>
</production>
<production ntsymbol="production_def" reducetype="append">
<ntsymbol name="ids"/><ntsymbol name="prec_decl"/><tsymbol
name="reducetype_decl"/>
</production>
<production ntsymbol="ids" reducetype="append">
<ntsymbol name="ids"/><tsymbol name="id"/>
</production>
<production ntsymbol="ids" reducetype="append">
<tsymbol name="id"/>
</production>
</productions>
<ssymbol ntsymbol="grammar"/>
</grammar>
1.1 xml-cocoon2/src/blocks/chaperon/samples/grammars/wiki.grm
Index: wiki.grm
===================================================================
<?xml version="1.0" encoding="US-ASCII"?>
<!--<!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 1.0//EN"
"grammar.dtd">-->
<grammar uri="http://chaperon.sourceforge.net/grammar/wiki/1.0">
<tokens>
<token tsymbol="LINE">
<concat>
<string content="---"/>
<concat maxOccurs="*" minOccurs="1">
<string content="-"/>
</concat>
</concat>
</token>
<token tsymbol="QUOTE">
<string content=":"/>
</token>
<token tsymbol="BULLETED">
<concat maxOccurs="*" minOccurs="1">
<string content="*"/>
</concat>
</token>
<token tsymbol="NUMBERED3">
<string content="###"/>
</token>
<token tsymbol="NUMBERED2">
<string content="##"/>
</token>
<token tsymbol="NUMBERED1">
<string content="#"/>
</token>
<token tsymbol="HEAD">
<concat maxOccurs="*" minOccurs="1">
<string content="!"/>
</concat>
</token>
<token assoc="left" tsymbol="ITALIC">
<string content="""/>
</token>
<token assoc="left" tsymbol="BOLD">
<string content="__"/>
</token>
<token assoc="left" tsymbol="UNDERLINE">
<string content="_"/>
</token>
<token tsymbol="LINK">
<concat>
<alt>
<string content="http"/>
<string content="ftp"/>
<string content="mailto"/>
<string content="news"/>
</alt>
<string content=":"/>
<concat minOccurs="1" maxOccurs="3">
<string content="/"/>
</concat>
<concat maxOccurs="*" minOccurs="0">
<cc>
<ci min="A" max="Z"/>
<ci min="a" max="z"/>
<ci min="0" max="9"/>
<cs content="."/>
<cs content="_"/>
<cs content="-"/>
</cc>
</concat>
</concat>
</token>
<token tsymbol="BOPEN">
<string content="["/>
</token>
<token tsymbol="BCLOSE">
<string content="]"/>
</token>
<token tsymbol="TEXT">
<concat>
<concat maxOccurs="*" minOccurs="1">
<cc>
<ci min="A" max="Z"/>
<ci min="a" max="z"/>
<ci min="0" max="9"/>
<cs content=","/>
<cs content="'"/>
<cs content="."/>
<cs content="?"/>
<cs content=":"/>
</cc>
</concat>
<concat maxOccurs="*" minOccurs="0">
<cc>
<ci min="A" max="Z"/>
<ci min="a" max="z"/>
<ci min="0" max="9"/>
<cs content=" "/>
<cs content=" "/>
<cs content=","/>
<cs content="'"/>
<cs content="."/>
<cs content="?"/>
<cs content="!"/>
<cs content=":"/>
</cc>
</concat>
</concat>
</token>
<token assoc="left" tsymbol="EMPTY">
<alt>
<concat>
<string content=" "/>
<concat maxOccurs="*" minOccurs="0">
<cc>
<cs content=" "/>
<cs content=" "/>
</cc>
</concat>
<string content=" "/>
</concat>
<concat>
<string content=" "/>
<concat maxOccurs="*" minOccurs="0">
<cc>
<cs content=" "/>
<cs content=" "/>
</cc>
</concat>
<string content=" "/>
</concat>
<concat>
<string content=" "/>
<concat maxOccurs="*" minOccurs="0">
<cc>
<cs content=" "/>
<cs content=" "/>
</cc>
</concat>
<string content=" "/>
</concat>
</alt>
</token>
<token tsymbol="EOL">
<alt>
<concat>
<string content=" "/>
<concat maxOccurs="1" minOccurs="0">
<string content=" "/>
</concat>
</concat>
<string content=" "/>
</alt>
</token>
</tokens>
<ignorabletokens>
<token tsymbol="whitespace">
<concat maxOccurs="*" minOccurs="1">
<cc>
<cs content=" "/>
<cs content=" "/>
<cs content=" "/>
</cc>
</concat>
</token>
</ignorabletokens>
<productions>
<production ntsymbol="wiki" reducetype="append">
<ntsymbol name="wiki"/>
<ntsymbol name="paragraphs"/>
</production>
<production ntsymbol="wiki" reducetype="append">
<ntsymbol name="paragraphs"/>
</production>
<production ntsymbol="paragraphs" reducetype="append">
<ntsymbol name="paragraphs"/>
<ntsymbol name="paragraph"/>
</production>
<production ntsymbol="paragraphs" reducetype="append">
<ntsymbol name="paragraph"/>
</production>
<production ntsymbol="paragraph">
<ntsymbol name="bulletedlist"/>
</production>
<production ntsymbol="paragraph">
<ntsymbol name="numberedlist1"/>
</production>
<production ntsymbol="paragraph">
<ntsymbol name="textitem"/>
</production>
<production ntsymbol="paragraph">
<ntsymbol name="headitem"/>
</production>
<production ntsymbol="paragraph">
<ntsymbol name="footnote"/>
</production>
<production ntsymbol="paragraph">
<tsymbol name="LINE"/>
</production>
<production ntsymbol="paragraph">
<tsymbol name="EMPTY"/>
</production>
<production ntsymbol="bulletedlist" reducetype="append">
<ntsymbol name="bulletedlist"/>
<ntsymbol name="bulletedlistitem"/>
</production>
<production ntsymbol="bulletedlist" reducetype="append">
<ntsymbol name="bulletedlistitem"/>
</production>
<production ntsymbol="bulletedlistitem">
<tsymbol name="BULLETED"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="bulletedlistitem">
<tsymbol name="BULLETED"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="numberedlist1" reducetype="append">
<ntsymbol name="numberedlist1"/>
<ntsymbol name="numberedlistitem1"/>
</production>
<production ntsymbol="numberedlist1" reducetype="append">
<ntsymbol name="numberedlistitem1"/>
</production>
<production ntsymbol="numberedlist1" reducetype="append">
<ntsymbol name="numberedlist1"/>
<ntsymbol name="numberedlist2"/>
</production>
<production ntsymbol="numberedlist1" reducetype="append">
<ntsymbol name="numberedlist2"/>
</production>
<production ntsymbol="numberedlistitem1">
<tsymbol name="NUMBERED1"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="numberedlistitem1">
<tsymbol name="NUMBERED1"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="numberedlist2" reducetype="append">
<ntsymbol name="numberedlist2"/>
<ntsymbol name="numberedlistitem2"/>
</production>
<production ntsymbol="numberedlist2" reducetype="append">
<ntsymbol name="numberedlistitem2"/>
</production>
<production ntsymbol="numberedlist2" reducetype="append">
<ntsymbol name="numberedlist2"/>
<ntsymbol name="numberedlist3"/>
</production>
<production ntsymbol="numberedlist2" reducetype="append">
<ntsymbol name="numberedlist3"/>
</production>
<production ntsymbol="numberedlistitem2">
<tsymbol name="NUMBERED2"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="numberedlistitem2">
<tsymbol name="NUMBERED2"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="numberedlist3" reducetype="append">
<ntsymbol name="numberedlist3"/>
<ntsymbol name="numberedlistitem3"/>
</production>
<production ntsymbol="numberedlist3" reducetype="append">
<ntsymbol name="numberedlistitem3"/>
</production>
<production ntsymbol="numberedlistitem3">
<tsymbol name="NUMBERED3"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="numberedlistitem3">
<tsymbol name="NUMBERED3"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="textitem">
<ntsymbol name="firstblock"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="textitem">
<ntsymbol name="firstblock"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="textitem">
<ntsymbol name="firstblock"/>
</production>
<production ntsymbol="headitem">
<tsymbol name="HEAD"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="headitem">
<tsymbol name="HEAD"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="footnote">
<ntsymbol name="note"/>
<ntsymbol name="textblock"/>
<ntsymbol name="textsequence"/>
</production>
<production ntsymbol="footnote">
<ntsymbol name="note"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="textsequence" reducetype="resolve">
<ntsymbol name="textsequence"/>
<tsymbol name="EOL"/>
</production>
<production ntsymbol="textsequence" reducetype="resolve">
<tsymbol name="EOL"/>
</production>
<production ntsymbol="textsequence" reducetype="resolve">
<ntsymbol name="textsequence"/>
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="textsequence" reducetype="resolve">
<ntsymbol name="textblock"/>
</production>
<production ntsymbol="textblock">
<tsymbol name="LINK"/>
</production>
<production ntsymbol="textblock">
<ntsymbol name="boldblock"/>
</production>
<production ntsymbol="textblock">
<ntsymbol name="italicblock"/>
</production>
<production ntsymbol="textblock">
<ntsymbol name="underlineblock"/>
</production>
<production ntsymbol="textblock">
<tsymbol name="TEXT"/>
</production>
<production ntsymbol="textblock">
<ntsymbol name="note"/>
</production>
<production ntsymbol="firstblock">
<tsymbol name="LINK"/>
</production>
<production ntsymbol="firstblock">
<ntsymbol name="boldblock"/>
</production>
<production ntsymbol="firstblock">
<ntsymbol name="italicblock"/>
</production>
<production ntsymbol="firstblock">
<ntsymbol name="underlineblock"/>
</production>
<production ntsymbol="firstblock">
<tsymbol name="TEXT"/>
</production>
<production ntsymbol="italicblock">
<tsymbol name="ITALIC"/>
<tsymbol name="TEXT"/>
<tsymbol name="ITALIC"/>
</production>
<production ntsymbol="boldblock">
<tsymbol name="BOLD"/>
<tsymbol name="TEXT"/>
<tsymbol name="BOLD"/>
</production>
<production ntsymbol="underlineblock">
<tsymbol name="UNDERLINE"/>
<tsymbol name="TEXT"/>
<tsymbol name="UNDERLINE"/>
</production>
<production ntsymbol="note">
<tsymbol name="BOPEN"/>
<tsymbol name="TEXT"/>
<tsymbol name="BCLOSE"/>
</production>
<production ntsymbol="note">
<tsymbol name="BOPEN"/>
<tsymbol name="LINK"/>
<tsymbol name="BCLOSE"/>
</production>
</productions>
<ssymbol ntsymbol="wiki"/>
</grammar>
1.1
xml-cocoon2/src/blocks/chaperon/samples/grammars/wiki.rgrm
Index: wiki.rgrm
===================================================================
%uri "http://chaperon.sourceforge.net/grammar/wiki/1.0";
%token LINE \-\-\-(\-)+;
%token QUOTE :;
%token BULLETED (\*)+;
%token NUMBERED3 \#\#\#;
%token NUMBERED2 \#\#;
%token NUMBERED1 \#;
%token HEAD (\!)+;
%left ITALIC \";
%left BOLD __;
%left UNDERLINE _;
%token LINK (http|ftp|mailto|news):(/){1,3}[A-Za-z0-9\.\_\-]*;
%token BOPEN \[;
%token BCLOSE \];
%token TEXT [A-Za-z0-9\,\'\.\?\:]+[A-Za-z0-9\ \t\,\'\.\?\!\:]*;
%left EMPTY \r\n [\ \t]* \r\n |
\r [\ \t]* \r |
\n [\ \t]* \n ;
%token EOL (\r(\n)?|\n);
%start wiki;
%ignore whitespace [\ \r\n]+;
%%
wiki : wiki paragraphs %append
| paragraphs %append
;
paragraphs : paragraphs paragraph %append
| paragraph %append
;
paragraph : bulletedlist
| numberedlist1
| textitem
| headitem
| footnote
| LINE
| EMPTY
;
bulletedlist : bulletedlist bulletedlistitem %append
| bulletedlistitem %append
;
bulletedlistitem : BULLETED textblock textsequence
| BULLETED textblock
;
numberedlist1 : numberedlist1 numberedlistitem1 %append
| numberedlistitem1 %append
| numberedlist1 numberedlist2 %append
| numberedlist2 %append
;
numberedlistitem1 : NUMBERED1 textblock textsequence
| NUMBERED1 textblock
;
numberedlist2 : numberedlist2 numberedlistitem2 %append
| numberedlistitem2 %append
| numberedlist2 numberedlist3 %append
| numberedlist3 %append
;
numberedlistitem2 : NUMBERED2 textblock textsequence
| NUMBERED2 textblock
;
numberedlist3 : numberedlist3 numberedlistitem3 %append
| numberedlistitem3 %append
;
numberedlistitem3 : NUMBERED3 textblock textsequence
| NUMBERED3 textblock
;
textitem : firstblock textblock textsequence
| firstblock textblock
| firstblock
;
headitem : HEAD textblock textsequence
| HEAD textblock
;
footnote : note textblock textsequence
| note textblock
;
textsequence : textsequence EOL %resolve
| EOL %resolve
| textsequence textblock %resolve
| textblock %resolve
;
textblock : LINK
| boldblock
| italicblock
| underlineblock
| TEXT
| note
;
firstblock : LINK
| boldblock
| italicblock
| underlineblock
| TEXT
;
italicblock : ITALIC TEXT ITALIC
;
boldblock : BOLD TEXT BOLD
;
underlineblock : UNDERLINE TEXT UNDERLINE
;
note : BOPEN TEXT BCLOSE
| BOPEN LINK BCLOSE
;
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/java.css
Index: java.css
===================================================================
body { background-color: #FFFFFF; }
body { color: #000000}
#Header { color: #ffffff; background-color:#8697a5 }
#CharacerLiteral { color: #FF00FF; }
#StringLiteral { color: #FF00FF; }
#SingleLineComment { color: #008000; }
#FormalComment { color: #008000; }
#MultiLineComment { color: #008000; }
#ABSTRACT { color: #0000FF ; font-weight: bold }
#BOOLEAN { color: #0000FF ; font-weight: bold }
#BREAK { color: #0000FF ; font-weight: bold }
#BYTE { color: #0000FF ; font-weight: bold }
#CASE { color: #0000FF ; font-weight: bold }
#CATCH { color: #0000FF ; font-weight: bold }
#CHAR { color: #0000FF ; font-weight: bold }
#CLASS { color: #0000FF ; font-weight: bold }
#CONST { color: #0000FF ; font-weight: bold }
#CONTINUE { color: #0000FF ; font-weight: bold }
#DEFAULT { color: #0000FF ; font-weight: bold }
#DO { color: #0000FF ; font-weight: bold }
#DOUBLE { color: #0000FF ; font-weight: bold }
#ELSE { color: #0000FF ; font-weight: bold }
#EXTENDS { color: #0000FF ; font-weight: bold }
#FALSE { color: #0000FF ; font-weight: bold }
#FINAL { color: #0000FF ; font-weight: bold }
#FINALLY { color: #0000FF ; font-weight: bold }
#FLOAT { color: #0000FF ; font-weight: bold }
#FOR { color: #0000FF ; font-weight: bold }
#GOTO { color: #0000FF ; font-weight: bold }
#IF { color: #0000FF ; font-weight: bold }
#IMPLEMENTS { color: #0000FF ; font-weight: bold }
#IMPORT { color: #0000FF ; font-weight: bold }
#INSTANCEOF { color: #0000FF ; font-weight: bold }
#INT { color: #0000FF ; font-weight: bold }
#INTERFACE { color: #0000FF ; font-weight: bold }
#LONG { color: #0000FF ; font-weight: bold }
#NATIVE { color: #0000FF ; font-weight: bold }
#NEW { color: #0000FF ; font-weight: bold }
#PACKAGE { color: #0000FF ; font-weight: bold }
#PRIVATE { color: #0000FF ; font-weight: bold }
#PROTECTED { color: #0000FF ; font-weight: bold }
#PUBLIC { color: #0000FF ; font-weight: bold }
#RETURN { color: #0000FF ; font-weight: bold }
#SHORT { color: #0000FF ; font-weight: bold }
#STATIC { color: #0000FF ; font-weight: bold }
#SUPER { color: #0000FF ; font-weight: bold }
#SWITCH { color: #0000FF ; font-weight: bold }
#SYCHRONIZED { color: #0000FF ; font-weight: bold }
#THIS { color: #0000FF ; font-weight: bold }
#THROW { color: #0000FF ; font-weight: bold }
#THROWS { color: #0000FF ; font-weight: bold }
#TRANSIENT { color: #0000FF ; font-weight: bold }
#TRUE { color: #0000FF ; font-weight: bold }
#TRY { color: #0000FF ; font-weight: bold }
#VOID { color: #0000FF ; font-weight: bold }
#VOLATILE { color: #0000FF ; font-weight: bold }
#WHILE { color: #0000FF ; font-weight: bold }
#StrictFP { color: #0000FF ; font-weight: bold }
#LITERAL { color: #b27b8c }
#IDENTIFIER { color: #000000 }
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/matex.xsp
Index: matex.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<html>
<head>
<title>Matex Exmaple</title>
</head>
<body>
<h1>Matex Exmaple</h1>
<p>
<textfragment
xmlns="http://chaperon.sourceforge.net/schema/textfragment/1.0"><xsp-request:get-parameter
name="text"
default="M^+(t) = {i} M^{p_0}_1 \\left( P_3^4 - PQP^5_667 +
\\frac{PQ}67.89PQP - \\right)"/></textfragment>
</p>
<p>
<form action="matex.html" method="get">
<xsp:element name="input">
<xsp:attribute name="name">text</xsp:attribute>
<xsp:attribute name="type">text</xsp:attribute>
<xsp:attribute name="size">80</xsp:attribute>
<xsp:attribute name="maxlength">110</xsp:attribute>
<xsp:attribute name="value"><xsp-request:get-parameter name="text"
default="M^+(t) = {i} M^{p_0}_1 \\left( P_3^4 - PQP^5_667 +
\\frac{PQ}67.89PQP - \\right)"/></xsp:attribute>
</xsp:element>
</form>
</p>
</body>
</html>
</xsp:page>
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/mathexp.xsp
Index: mathexp.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<html>
<head>
<title>Mathexp Example</title>
</head>
<body>
<h1>Mathexp Example</h1>
<p>
<textfragment
xmlns="http://chaperon.sourceforge.net/schema/textfragment/1.0"><xsp-request:get-parameter
name="text"
default="3*a-5*6/7 + ( b-c)*5- b"/></textfragment>
</p>
<p>
<form action="mathexp.html" method="post">
<xsp:element name="input">
<xsp:attribute name="name">text</xsp:attribute>
<xsp:attribute name="type">text</xsp:attribute>
<xsp:attribute name="size">80</xsp:attribute>
<xsp:attribute name="maxlength">110</xsp:attribute>
<xsp:attribute name="value"><xsp-request:get-parameter name="text"
default="3*a-5*6/7 + ( b-c)*5- b"/></xsp:attribute>
</xsp:element>
</form>
</p>
</body>
</html>
</xsp:page>
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/samples.xml
Index: samples.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Main examples page.">
<sample name="Back" href="..">to Cocoon examples main page</sample>
</group>
<group name="Mathexp example">
<sample name="Mathexp" href="mathexp.html">This example demonstrate how
parser can be use to
parse input text, like mathematical expressions.</sample>
</group>
<group name="Wiki example">
<sample name="Wiki" href="wiki.html">In this example the parser were used
to build an online editor,
which based on the very popular syntax of Wiki.</sample>
</group>
<group name="Syntax highlighting example">
<sample name="Example 1" href="java1.html">The parser also be used to
colorize
some source code. (Need once 2-3min, for the parser table generation
process)
</sample>
<sample name="Example 2" href="java2.html">Another example.
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/test1.java
Index: test1.java
===================================================================
/*
* Copyright (C) Chaperon. All rights reserved.
* -------------------------------------------------------------------------
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package example;
public class Example
{
public String concat(String param1, String param2)
{
return param1 + param2;
}
}
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/test2.java
Index: test2.java
===================================================================
/*
* Copyright (C) Chaperon. All rights reserved.
* -------------------------------------------------------------------------
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package net.sourceforge.chaperon.helpers;
/**
* The class maskes special characters
*
* @author Stephan Michels
* @version %version%
*/
public class Decoder
{
/**
* Mask special characters
*
* @param string String
*
* @return Mask string
*/
public static String decode(String string)
{
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < string.length(); i++)
{
if (string.charAt(i) == '\n')
buffer.append("\\n");
else if (string.charAt(i) == '\t')
buffer.append("\\t");
else if (string.charAt(i) == '\r')
buffer.append("\\r");
else if (string.charAt(i) == '\"')
buffer.append("\"");
else if (string.charAt(i) == '\\')
buffer.append("\\");
else if ((string.charAt(i) >= '!') && (string.charAt(i) <= '~'))
buffer.append(string.charAt(i));
else
{
String hexstring = Integer.toHexString((int) string.charAt(i));
String zeros = "0000";
buffer.append("\\u" + zeros.substring(4 - hexstring.length())
+ hexstring);
}
}
return buffer.toString();
}
}
1.1 xml-cocoon2/src/blocks/chaperon/samples/misc/wiki.xsp
Index: wiki.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<html>
<head>
<title>Wiki example</title>
<style>
.title
{
text-align: center;
font-size: 18px;
font-weight: bold;
font-family: sans-serif,Arial,Tahoma;
color: black;
background: white;
border-color: black;
border-width: 10px;
}
.main
{
border: 1px solid #0086B2;
padding: 0px;
margin: 6px;
min-width: 630px;
}
.head
{
border-bottom: #0086B2;
border-width: 0 0 1px 0;
border-style: none none solid none;
padding: 6px 6px 3px 6px;
}
.block { padding: 6px; }
.confirm
{
width: 40%;
margin-left: 50%;
padding: 6px;
}
.content
{
border: 1px solid #0086B2;
padding: 6px;
margin: 1px;
}
tr
{
padding: 2px 6px 2px 6px;
}
.col1
{
font-weight: bold;
}
.error .col1
{
padding: 2px 20px 2px 6px;
}
.error .col2
{
color:#BB0000;
padding: 2px 20px 2px 6px;
}
.field { }
.notify
{
font-size: 15px;
text-align: left;
}
.tools { text-align: right; }
.tool { padding: 6px; }
.notes
{
font-size: 12px;
font-weight: bold;
color: white;
background: #0086B2;
text-align: left;
padding: 6px 6px 3px 6px;
}
.foot
{
text-align: center;
font-size: 12px;
margin-top: 50px;
}
.hspace { margin: 30px; }
#left { float: left; }
#right { float: right; }
#center { text-align: center; }
#row { background: #EEFFFF; }
.failure
{
font-weight: bold;
color: #BB0000;
}
.warning
{
font-weight: bold;
color: #BB0000;
}
.success
{
font-weight: bold;
color: green;
}
.tab
{
font-size: 12px;
font-weight: bold;
color: white;
background: #0086B2;
padding: 4px 4px 2px 4px;
border: 0px solid #0086B2;
margin: 1px;
}
.tab a
{
text-decoration: none;
color: white;
}
.tab a:visited
{
text-decoration: none;
color: white;
}
.tab a:link
{
text-decoration: none;
color: white;
}
.tab a:hover
{
text-decoration: underline;
color: red;
}
a { text-decoration: none; }
a:hover
{
text-decoration: underline;
color: red;
}
body
{
font-size: 12px;
font-family: sans-serif,Arial,Tahoma;
color: black;
background: white;
}
form { font-size: 12px; }
textarea
{
background-color: #EEFFFF;
font-size: 12px;
font-family: geneva,arial,sans-serif;
border-color: #0086B2;
border-width: 1px;
padding-left: 2px;
}
textarea.hidden { display: none; }
input
{
background-color: #EEFFFF;
font-size: 12px;
font-family: geneva,arial,sans-serif;
border-color: #0086B2;
border-width: 1px;
padding-left: 2px;
}
input.submit
{
background-color: #0086B2;
font-size: 12px;
font-family: geneva,arial,sans-serif;
border-color: black;
border-width: 1px;
padding: 2px 6px;
font-weight: bold;
color: white;
}
input.button
{
background-color: #BB0000;
font-size: 12px;
font-family: geneva,arial,sans-serif;
border-color: black;
border-width: 1px;
padding: 2px 6px;
font-weight: bold;
color: white;
}
</style>
</head>
<body>
<div class="title">Wiki example</div>
<p>
<div class="block"><span class="tab">Preview</span><div class="content">
<textfragment
xmlns="http://chaperon.sourceforge.net/schema/textfragment/1.0"><xsp-request:get-parameter
name="text" default="No text"/></textfragment>
</div></div>
</p>
<p>
<form action="wiki.html" method="post">
<div class="block"><span class="tab">Content</span><div class="field">
<textarea name="text" type="textarea" cols="100" rows="23" style="width:
100%">!Example heading
!!bold and italics stuff
Here's some __bold text__ and now "some italic text I hope ". Not
sure about italics though.
!!bullets
* first bulleted item
* second bulleted item
!!numbered lists
# number list point 1
## is that 1.1?
### is that 1.1.1?
# this is point 2
# and point 3
We _love_ horizontal rules [1]
------------
Brought to you by [http://www.perdu.com].
[1] and footnotes too.
</textarea><br/>
</div></div>
<div style="text-align:right" class="block">
<input value="Preview" type="submit" class="submit"/>
</div>
</form>
</p>
</body>
</html>
</xsp:page>
1.1
xml-cocoon2/src/blocks/chaperon/samples/stylesheets/java2html.xsl
Index: java2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://chaperon.sourceforge.net/grammar/java/1.0"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output indent="no"/>
<!--<xsl:strip-space elements="*"/>-->
<xsl:param name="selected">MethodDeclaration</xsl:param>
<xsl:template match="java:CompilationUnit" >
<html>
<head>
<link rel="stylesheet" type="text/css" href="java.css" title="Style"/>
<title>java2html example</title>
</head>
<body>
<table id="Header" border="0" cellpadding="0" cellspacing="0"
width="100%">
<tr>
<td colspan="2" width="33%"> </td>
<td align="center" colspan="2" width="33%">
<font size="4">java2html example</font>
</td>
<td align="right" colspan="2" width="33%"></td>
</tr>
</table>
<!-- <p>
<form>
<select size="1" name="selected">
<option value=""><xsl:if test="$selected=''"><xsl:attribute
name="selected"/></xsl:if>Nothing selected</option>
<option value="QualifiedName"><xsl:if
test="$selected='QualifiedName'"><xsl:attribute
name="selected"/></xsl:if>Qualified name</option>
<option value="FieldVariableDeclaration"><xsl:if
test="$selected='FieldVariableDeclaration'"><xsl:attribute
name="selected"/></xsl:if>Field variable declaration</option>
<option value="MethodDeclaration"><xsl:if
test="$selected='MethodDeclaration'"><xsl:attribute
name="selected"/></xsl:if>Method declaration</option>
<option value="SelectionStatement"><xsl:if
test="$selected='SelectionStatement'"><xsl:attribute
name="selected"/></xsl:if>Selection statement</option>
<option value="IterationStatement"><xsl:if
test="$selected='IterationStatement'"><xsl:attribute
name="selected"/></xsl:if>Iteration statement</option>
<option value="GuardingStatement"><xsl:if
test="$selected='GuardingStatement'"><xsl:attribute
name="selected"/></xsl:if>Guarding statement</option>
</select>
</form>
</p>-->
<pre id="Classes">
<xsl:apply-templates/>
</pre>
</body>
</html>
</xsl:template>
<xsl:template match="java:ABSTRACT">
<font id="ABSTRACT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:BOOLEAN">
<font id="BOOLEAN"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:BREAK">
<font id="BREAK"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:BYTE">
<font id="BYTE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CASE">
<font id="CASE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CATCH">
<font id="CATCH"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CHAR">
<font id="CHAR"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CLASS">
<font id="CLASS"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CONST">
<font id="CONST"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:CONTINUE">
<font id="CONTINUE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:DEFAULT">
<font id="DEFAULT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:DO">
<font id="DO"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:DOUBLE">
<font id="DOUBLE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:ELSE">
<font id="ELSE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:EXTENDS">
<font id="EXTENDS"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:FALSE">
<font id="FALSE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:FINAL">
<font id="FINAL"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:FINALLY">
<font id="FINALLY"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:FLOAT">
<font id="FLOAT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:FOR">
<font id="FOR"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:GOTO">
<font id="GOTO"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:IF">
<font id="IF"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:IMPLEMENTS">
<font id="IMPLEMENTS"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:IMPORT">
<font id="IMPORT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:INSTANCEOF">
<font id="INSTANCEOF"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:INT">
<font id="INT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:INTERFACE">
<font id="INTERFACE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:LONG">
<font id="LONG"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:NATIVE">
<font id="NATIVE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:NEW">
<font id="NEW"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:PACKAGE">
<font id="PACKAGE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:PRIVATE">
<font id="PRIVATE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:PROTECTED">
<font id="PROTECTED"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:PUBLIC">
<font id="PUBLIC"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:RETURN">
<font id="RETURN"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:SHORT">
<font id="SHORT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:STATIC">
<font id="STATIC"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:SUPER">
<font id="SUPER"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:SWITCH">
<font id="SWITCH"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:SYCHRONIZED">
<font id="SYCHRONIZED"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:THIS">
<font id="THIS"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:THROW">
<font id="THROW"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:THROWS">
<font id="THROWS"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:TRANSIENT">
<font id="TRANSIENT"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:TRUE">
<font id="TRUE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:TRY">
<font id="TRY"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:VOID">
<font id="VOID"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:VOLATILE">
<font id="VOLATILE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:WHILE">
<font id="WHILE"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:LITERAL">
<font id="LITERAL"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:IDENTIFIER">
<font id="IDENTIFIER"><xsl:apply-templates/></font>
</xsl:template>
<xsl:template match="java:DOPEN">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DCLOSE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:COPEN">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:CCLOSE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:BOPEN">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:BCLOSE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:SEMICOLON">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:COMMA">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DOT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_EQ">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_LE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_GE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_NE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_LOR">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_LAND">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_INC">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_DEC">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_SHR">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_SHL">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OP_SHRR">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ASS_OP">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:EQ">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:GT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:NOT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:TILDE">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:QM">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:COLON">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PLUS">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MINUS">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MULT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DIV">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:AND">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:OR">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:XOR">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MOD">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:BOOLLIT">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:eol">
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="java:whitespace">
<!--<xsl:text><xsl:value-of select="."/></xsl:text>-->
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="java:comment">
<font id="MultiLineComment"><xsl:value-of select="."/></font>
</xsl:template>
<xsl:template match="java:TypeSpecifier">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:TypeName">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ClassNameList">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PrimitiveType">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:SemiColons">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ProgramFile">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PackageStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:TypeDeclarations">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:TypeDeclarationOptSemi">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ImportStatements">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ImportStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:QualifiedName">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:TypeDeclaration">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ClassHeader">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Modifiers">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Modifier">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ClassWord">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Interfaces">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:FieldDeclarations">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:FieldDeclarationOptSemi">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:FieldDeclaration">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:FieldVariableDeclaration">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:VariableDeclarators">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:VariableDeclarator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:VariableInitializer">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ArrayInitializers">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MethodDeclaration">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:MethodDeclarator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ParameterList">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Parameter">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DeclaratorName">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Throws">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MethodBody">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConstructorDeclaration">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConstructorDeclarator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:StaticInitializer">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:NonStaticInitializer">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Extends">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Block">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LocalVariableDeclarationsAndStatements">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LocalVariableDeclarationOrStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LocalVariableDeclarationStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Statement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:EmptyStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LabelStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ExpressionStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:SelectionStatement">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:IterationStatement">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:ForInit">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ForExpr">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ForIncr">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ExpressionStatements">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:JumpStatement">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:GuardingStatement">
<xsl:choose>
<xsl:when test="$selected=local-name(.)">
<span class="selected"><xsl:apply-templates/></span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="java:Catches">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Catch">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:CatchHeader">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Finally">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PrimaryExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:NotJustName">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ComplexPrimary">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ComplexPrimaryNoParenthesis">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ArrayAccess">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:FieldAccess">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MethodCall">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MethodAccess">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:SpecialName">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ArgumentList">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:NewAllocationExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PlainNewAllocationExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ClassAllocationExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ArrayAllocationExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DimExprs">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:DimExpr">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Dims">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PostfixExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:RealPostfixExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:UnaryExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LogicalUnaryExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:LogicalUnaryOperator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ArithmeticUnaryOperator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:CastExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:PrimitiveTypeExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ClassTypeExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:MultiplicativeExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:AdditiveExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ShiftExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:RelationalExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:EqualityExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:AndExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ExclusiveOrExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:InclusiveOrExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConditionalAndExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConditionalOrExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConditionalExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:AssignmentExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:AssignmentOperator">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:Expression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="java:ConstantExpression">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/blocks/chaperon/samples/stylesheets/mathexp2html.xsl
Index: mathexp2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:m="http://chaperon.sourceforge.net/grammar/mathexp/1.0"
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:template match="m:E">
<table bgcolor="#a0ffff" cellspacing="1">
<tr>
<xsl:for-each select="child::node()">
<td>
<xsl:apply-templates select="."/>
</td>
</xsl:for-each>
</tr>
</table>
</xsl:template>
<xsl:template match="m:F">
<table bgcolor="#ffffa0" cellspacing="1">
<tr>
<xsl:for-each select="child::node()">
<td>
<xsl:apply-templates select="."/>
</td>
</xsl:for-each>
</tr>
</table>
</xsl:template>
<xsl:template match="m:T">
<table bgcolor="#ffa0ff" cellspacing="1">
<tr>
<xsl:for-each select="child::node()">
<td>
<xsl:apply-templates select="."/>
</td>
</xsl:for-each>
</tr>
</table>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/blocks/chaperon/samples/stylesheets/parsefragment.xsl
Index: parsefragment.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tf="http://chaperon.sourceforge.net/schema/textfragment/1.0">
<xsl:param name="parse_element">math</xsl:param>
<xsl:template match="*[name()=$parse_element]">
<xsl:element name="{$parse_element}">
<tf:textfragment>
<xsl:value-of select="."/>
</tf:textfragment>
</xsl:element>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/blocks/chaperon/samples/stylesheets/rgrm2grm.xsl
Index: rgrm2grm.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rgrm="http://chaperon.sourceforge.net/grammar/rgrm/1.0"
xmlns="http://chaperon.sourceforge.net/schema/grammar/1.0">
<xsl:output indent="yes" method="xml" encoding="US-ASCII"/>
<!-- <xsl:template match="/">
</xsl:template>-->
<xsl:template match="rgrm:grammar" >
<grammar>
<xsl:attribute name="uri"><xsl:value-of
select="substring(rgrm:token_decls/rgrm:uri_decl/rgrm:string,2,
string-length(rgrm:token_decls/rgrm:uri_decl/rgrm:string)-2)"/></xsl:attribute>
<tokens>
<xsl:apply-templates select="rgrm:token_decls/rgrm:token_decl"/>
</tokens>
<ignorabletokens>
<xsl:apply-templates select="rgrm:token_decls/rgrm:ignorabletoken_decl"/>
</ignorabletokens>
<xsl:apply-templates select="rgrm:production_decls"/>
<xsl:apply-templates select="rgrm:token_decls/rgrm:start_decl"/>
</grammar>
</xsl:template>
<xsl:template match="rgrm:token_decl" >
<token>
<xsl:if test="rgrm:token_decl = '%left'">
<xsl:attribute name="assoc">left</xsl:attribute>
</xsl:if>
<xsl:if test="rgrm:token_decl = '%right'">
<xsl:attribute name="assoc">right</xsl:attribute>
</xsl:if>
<xsl:attribute name="tsymbol"><xsl:value-of
select="rgrm:id"/></xsl:attribute>
<xsl:apply-templates select="rgrm:regexexpression"/>
</token>
</xsl:template>
<xsl:template match="rgrm:ignorabletoken_decl" >
<token>
<xsl:attribute name="tsymbol"><xsl:value-of
select="rgrm:id"/></xsl:attribute>
<xsl:apply-templates select="rgrm:regexexpression"/>
</token>
</xsl:template>
<xsl:template match="rgrm:regexexpression" >
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|
rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</xsl:template>
<xsl:template match="rgrm:regexalternation" >
<alt>
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</alt>
</xsl:template>
<xsl:template match="rgrm:regexconcatenation" >
<concat>
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:template>
<xsl:template match="rgrm:regexquantifier" >
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</xsl:template>
<xsl:template match="rgrm:regexoptional" >
<concat minOccurs="0" maxOccurs="1">
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:template>
<xsl:template match="rgrm:regexstar" >
<concat minOccurs="0" maxOccurs="*">
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:template>
<xsl:template match="rgrm:regexplus" >
<concat minOccurs="1" maxOccurs="*">
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:template>
<xsl:template match="rgrm:regexvar" >
<xsl:choose>
<xsl:when test="count(rgrm:regexmultiplicator/rgrm:number)=2">
<concat>
<xsl:attribute name="minOccurs"><xsl:value-of
select="rgrm:regexmultiplicator/rgrm:number[1]"/></xsl:attribute>
<xsl:attribute name="maxOccurs"><xsl:value-of
select="rgrm:regexmultiplicator/rgrm:number[2]"/></xsl:attribute>
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:when>
<xsl:otherwise>
<concat>
<xsl:attribute name="minOccurs"><xsl:value-of
select="rgrm:regexmultiplicator/rgrm:number"/></xsl:attribute>
<xsl:attribute name="maxOccurs"><xsl:value-of
select="rgrm:regexmultiplicator/rgrm:number"/></xsl:attribute>
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexdot|rgrm:regexbol|rgrm:regexeol|rgrm:regexabref"/>
</concat>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="rgrm:regexterm" >
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexabref"/>
</xsl:template>
<xsl:template match="rgrm:regexklammer" >
<xsl:apply-templates
select="rgrm:regexalternation|rgrm:regexconcatenation|rgrm:regexklammer|rgrm:regexoptional|rgrm:regexstar|
rgrm:regexplus|rgrm:regexvar|rgrm:string|rgrm:characterclass|rgrm:negatedcharacterclass|rgrm:regexabref"/>
</xsl:template>
<xsl:template match="rgrm:regexdot" >
<dot/>
</xsl:template>
<xsl:template match="rgrm:regexbol" >
<bol/>
</xsl:template>
<xsl:template match="rgrm:regexeol" >
<eol/>
</xsl:template>
<xsl:template match="rgrm:regexabref" >
<xsl:variable name="ref" select="rgrm:id"/>
<xsl:apply-templates
select="/rgrm:grammar/rgrm:token_decls/rgrm:ab_decl[rgrm:id=$ref]/rgrm:regexexpression"/>
</xsl:template>
<!--<xsl:template match="string" >
<string>
<xsl:attribute name="content"><xsl:value-of
select="translate(normalize-space(substring(., 2, string-length(.)-2)),' ',
'')"/></xsl:attribute>
</string>
</xsl:template>-->
<xsl:template match="rgrm:string" >
<string>
<xsl:attribute name="content"><xsl:apply-templates
select="rgrm:character|rgrm:maskedcharacter" mode="string"/></xsl:attribute>
</string>
</xsl:template>
<xsl:template match="rgrm:characterclass" >
<cc>
<xsl:apply-templates
select="rgrm:character|rgrm:maskedcharacter|rgrm:intervall"/>
</cc>
</xsl:template>
<xsl:template match="rgrm:negatedcharacterclass" >
<ncc>
<xsl:apply-templates
select="rgrm:character|rgrm:maskedcharacter|rgrm:intervall"/>
</ncc>
</xsl:template>
<xsl:template match="rgrm:character" >
<cs>
<xsl:attribute name="content"><xsl:value-of
select="translate(normalize-space(.), ' ', '')"/></xsl:attribute>
</cs>
</xsl:template>
<xsl:template match="rgrm:maskedcharacter" >
<cs>
<xsl:choose>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
'n'">
<xsl:attribute name="content"><xsl:text
disable-output-escaping="yes"> </xsl:text></xsl:attribute>
</xsl:when>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
'r'">
<xsl:attribute name="content"><xsl:text
disable-output-escaping="yes"> </xsl:text></xsl:attribute>
</xsl:when>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
't'">
<xsl:attribute name="content"><xsl:text
disable-output-escaping="yes">	</xsl:text></xsl:attribute>
</xsl:when>
<xsl:when test="contains(.,'\ ')">
<xsl:attribute name="content"><xsl:text
disable-output-escaping="yes"> </xsl:text></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="content"><xsl:value-of
select="substring(translate(normalize-space(.), ' ', ''),
2,1)"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</cs>
</xsl:template>
<xsl:template match="rgrm:character" mode="string">
<xsl:value-of select="translate(normalize-space(.), ' ', '')"/>
</xsl:template>
<xsl:template match="rgrm:maskedcharacter" mode="string">
<xsl:choose>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
'n'">
<xsl:text disable-output-escaping="yes"> </xsl:text>
</xsl:when>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
'r'">
<xsl:text disable-output-escaping="yes"> </xsl:text>
</xsl:when>
<xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) =
't'">
<xsl:text disable-output-escaping="yes">	</xsl:text>
</xsl:when>
<xsl:when test="contains(.,'\ ')">
<xsl:text disable-output-escaping="yes"> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(translate(normalize-space(.), ' ',
''),2,1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="rgrm:intervall" >
<ci>
<xsl:attribute name="min"><xsl:value-of
select="rgrm:character[1]"/></xsl:attribute>
<xsl:attribute name="max"><xsl:value-of
select="rgrm:character[2]"/></xsl:attribute>
</ci>
</xsl:template>
<xsl:template match="rgrm:comment_decl" >
<comment>
<xsl:apply-templates select="rgrm:regexexpression"/>
</comment>
</xsl:template>
<xsl:template match="rgrm:whitespace_decl" >
<whitespace>
<xsl:apply-templates select="rgrm:regexexpression"/>
</whitespace>
</xsl:template>
<xsl:template match="rgrm:production_decls" >
<productions>
<xsl:for-each
select="rgrm:production_decl/rgrm:production_defs/rgrm:production_def">
<production>
<xsl:attribute name="ntsymbol"><xsl:value-of
select="../../rgrm:id"/></xsl:attribute>
<xsl:choose>
<xsl:when test="rgrm:reducetype_decl[.='%append']">
<xsl:attribute name="reducetype">append</xsl:attribute>
</xsl:when>
<xsl:when test="rgrm:reducetype_decl[.='%resolve']">
<xsl:attribute name="reducetype">resolve</xsl:attribute>
</xsl:when>
<xsl:when test="rgrm:reducetype_decl[.='%neglect']">
<xsl:attribute name="reducetype">neglect</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:if test="rgrm:prec_decl">
<xsl:attribute name="prec"><xsl:value-of
select="rgrm:prec_decl/rgrm:id"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates select="rgrm:ids/rgrm:id"/>
</production>
</xsl:for-each>
</productions>
</xsl:template>
<xsl:template match="rgrm:id" >
<xsl:variable name="symbol" select="text()"/>
<xsl:choose>
<xsl:when
test="/rgrm:grammar/rgrm:token_decls/rgrm:token_decl/rgrm:id[.=$symbol]">
<tsymbol>
<xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
</tsymbol>
</xsl:when>
<xsl:otherwise>
<ntsymbol>
<xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
</ntsymbol>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="rgrm:start_decl" >
<ssymbol>
<xsl:attribute name="ntsymbol"><xsl:value-of
select="rgrm:id"/></xsl:attribute>
</ssymbol>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/blocks/chaperon/samples/stylesheets/wiki2html.xsl
Index: wiki2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wiki="http://chaperon.sourceforge.net/grammar/wiki/1.0"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output indent="yes" method="html"/>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="wiki:wiki">
<html>
<head>
<title>Wiki example</title>
</head>
<body>
<xsl:apply-templates select="wiki:wiki/wiki:paragraphs/wiki:paragraph"/>
</body>
</html>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="//wiki">
<div style="background: #b9d3ee; border: thin; border-color: black;
border-style: solid; padding-left: 0.8em;
padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px;
margin: 0.5ex 0px; clear: both;">
<xsl:apply-templates select="paragraphs/paragraph"/>
</div>
</xsl:template>
<xsl:template match="wiki:paragraph" >
<xsl:apply-templates
select="wiki:bulletedlist|wiki:numberedlist1|wiki:numberedlist2|wiki:numberedlist3|wiki:headitem|wiki:footnote|wiki:textitem|wiki:LINE"/>
</xsl:template>
<xsl:template match="wiki:textitem" >
<p>
<xsl:apply-templates select="wiki:firstblock|wiki:textblock"/>
</p>
</xsl:template>
<xsl:template match="wiki:textblock" >
<xsl:apply-templates
select="wiki:LINK|wiki:boldblock|wiki:italicblock|wiki:underlineblock|wiki:TEXT|wiki:note"/>
</xsl:template>
<xsl:template match="wiki:firstblock" >
<xsl:apply-templates
select="wiki:LINK|wiki:boldblock|wiki:italicblock|wiki:underlineblock|wiki:TEXT"/>
</xsl:template>
<xsl:template match="wiki:LINE" >
<hr/>
</xsl:template>
<xsl:template match="wiki:bulletedlist" >
<ul>
<xsl:apply-templates select="wiki:bulletedlistitem"/>
</ul>
</xsl:template>
<xsl:template match="wiki:bulletedlistitem" >
<li>
<xsl:apply-templates select="wiki:textblock"/>
</li>
</xsl:template>
<xsl:template match="wiki:numberedlist1" >
<ol>
<xsl:apply-templates select="wiki:numberedlistitem1|wiki:numberedlist2"/>
</ol>
</xsl:template>
<xsl:template match="wiki:numberedlistitem1" >
<li>
<xsl:apply-templates select="wiki:textblock"/>
</li>
</xsl:template>
<xsl:template match="wiki:numberedlist2" >
<ol>
<xsl:apply-templates select="wiki:numberedlistitem2|wiki:numberedlist3"/>
</ol>
</xsl:template>
<xsl:template match="wiki:numberedlistitem2" >
<li>
<xsl:apply-templates select="wiki:textblock"/>
</li>
</xsl:template>
<xsl:template match="wiki:numberedlist3" >
<ol>
<xsl:apply-templates select="wiki:numberedlistitem3"/>
</ol>
</xsl:template>
<xsl:template match="wiki:numberedlistitem3" >
<li>
<xsl:apply-templates select="wiki:textblock"/>
</li>
</xsl:template>
<xsl:template match="wiki:headitem" >
<xsl:choose>
<xsl:when test="string-length(wiki:HEAD)=2">
<h2>
<xsl:apply-templates select="wiki:textblock"/>
</h2>
</xsl:when>
<xsl:when test="string-length(wiki:HEAD)=3">
<h3>
<xsl:apply-templates select="wiki:textblock"/>
</h3>
</xsl:when>
<xsl:otherwise>
<h1>
<xsl:apply-templates select="wiki:textblock"/>
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="wiki:footnote" >
<a name="{normalize-space(wiki:note/wiki:TEXT|wiki:note/wiki:LINK)}">
[<xsl:apply-templates select="wiki:note/wiki:TEXT|wiki:note/wiki:LINK"/>]
<xsl:apply-templates select="wiki:textblock"/>
</a>
</xsl:template>
<xsl:template match="wiki:LINK" >
<a href="{normalize-space(.)}">
<xsl:value-of select="."/>
</a>
</xsl:template>
<xsl:template match="wiki:boldblock" >
<b>
<xsl:value-of select="wiki:TEXT"/>
</b>
</xsl:template>
<xsl:template match="wiki:italicblock" >
<i>
<xsl:value-of select="wiki:TEXT"/>
</i>
</xsl:template>
<xsl:template match="wiki:underlineblock" >
<u>
<xsl:value-of select="wiki:TEXT"/>
</u><xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="wiki:note" >
<a href="#{normalize-space(wiki:TEXT|wiki:LINK)}">
[<xsl:apply-templates select="wiki:TEXT|wiki:LINK"/>]
</a>
</xsl:template>
<xsl:template match="wiki:TEXT" >
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/jsp/conf/jsp.xsamples
Index: jsp.xsamples
===================================================================
<?xml version="1.0"?>
<xsamples xpath="/samples" unless="[EMAIL PROTECTED]'jsp']">
<group name="jsp">
<sample name="Java Server Pages" href="jsp/">
JSP usage with Cocoon
</sample>
</group>
</xsamples>
1.1 xml-cocoon2/src/blocks/jsp/samples/hello.jsp
Index: hello.jsp
===================================================================
<%@ page language='java' session='false' %>
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon2 page!</para>
<%
out.println("\t<para>With help from JSP on " + new java.util.Date() +
"</para>");
%>
</content>
</page>
1.1 xml-cocoon2/src/blocks/jsp/samples/simple-page2html.xsl
Index: simple-page2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="view-source"/>
<xsl:template match="page">
<html>
<head>
<title>
<xsl:value-of select="title"/>
</title>
</head>
<body bgcolor="white" alink="red" link="blue" vlink="blue">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="title">
<h2 style="color: navy; text-align: center">
<xsl:if test="not($view-source)">
<xsl:apply-templates/>
</xsl:if>
<xsl:if test="$view-source">
<A>
<xsl:attribute name="HREF">../view-source?filename=/<xsl:value-of
select="$view-source"/></xsl:attribute>
<xsl:attribute name="TARGET">_blank</xsl:attribute>
<xsl:apply-templates/>
</A>
</xsl:if>
</h2>
</xsl:template>
<xsl:template match="para">
<p align="left">
<i><xsl:apply-templates/></i>
</p>
</xsl:template>
<xsl:template match="@*|node()"
priority="-2"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>
<xsl:template match="text()" priority="-1"><xsl:value-of
select="."/></xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/jsp/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components
================================ -->
<map:components>
<map:generators default="file">
<!-- JspGenerator is used to get result of a JSP page
then output it as XML (SAX events)
-->
<map:generator logger="sitemap.generator.jsp" name="jsp"
src="org.apache.cocoon.generation.JspGenerator"/>
</map:generators>
<map:transformers default="xslt"/>
<map:readers default="resource">
<!-- JSPReader is used to serve direct output from
a JSP page. Note, that JSP result can be non XML -->
<map:reader logger="sitemap.reader.jsp" name="jsp"
src="org.apache.cocoon.reading.JSPReader"/>
</map:readers>
<map:serializers default="html"/>
<map:matchers default="wildcard"/>
<map:selectors default="browser"/>
</map:components>
<!-- =========================== Pipelines
================================= -->
<map:pipelines>
<map:pipeline>
<!-- This works only if TreeProcessor is used -->
<map:match pattern="">
<map:redirect-to uri="welcome.htm" />
</map:match>
<map:match pattern="*.htm">
<map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
</map:match>
<!-- Use this to debug your JSPs -->
<map:match pattern="*.xml">
<map:generate type="jsp" src="{1}.jsp"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="*.jsp">
<map:generate type="jsp" src="{1}.jsp"/>
<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=".jsp"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
<!-- end of file -->
1.1 xml-cocoon2/src/blocks/jsp/samples/welcome.jsp
Index: welcome.jsp
===================================================================
<%@ page import="java.util.*" %>
<%
response.setHeader("Expires", "0");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JSPreader test</title>
<style type="text/css">
BODY {background-color: #FFFFFF; color: #000066; font-family: Verdana,
Helvetica, Arial; }
</style>
</head>
<body>
<h3>This is a dynamic output from the JSPReader</h3>
<h4>Current time: <%=new Date()%></h4>
<hr noshade size="1">
<br>
<table width="75%" border="1" cellspacing="0" cellpadding="5">
<tr bgcolor="#990000">
<th colspan="2" align="left"><font color="#FFFFFF">JSP Usage
Samples</font></th>
</tr>
<tr>
<td width="25%"><a href="hello.jsp">hello.jsp</a></td>
<td width="56%">Displays a hello page using JspGenerator to get XML from
a
JSP then transformes it to HTML using a stylesheet.</td>
</tr>
<tr>
<td width="25%"><a href="hello.xml">hello.xml</a></td>
<td width="56%">The same page serialized as XML (without
transformation).</td>
</tr>
<tr>
<td width="25%"><a href="hello.htm">hello.htm</a></td>
<td width="56%">
<p>The same page serialized as HTML and served by sitemap through the
JSPReader.</p>
</td>
</tr>
<tr>
<td width="25%"><a href="welcome.htm">welcome.htm</a></td>
<td width="56%">This page. Direct HTML output from a JSP page served by
sitemap
through the JSPReader.</td>
</tr>
</table>
<p><small><a href=".."><br>
Back to samples</a></small> </p>
</body>
</html>
1.1 xml-cocoon2/src/blocks/profiler/samples/page2html.xsl
Index: page2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Apache Cocoon 2.1-dev</title>
<link rel="SHORTCUT ICON" href="favicon.ico"/>
<xsl:apply-templates select="page/style"/>
<xsl:apply-templates select="page/script"/>
</head>
<body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
<table border="0" cellspacing="2" cellpadding="2" align="center"
width="100%">
<tr>
<td width="*"><font face="arial,helvetica,sanserif" color="#000000">The
Apache Software Foundation is proud to
present...</font></td>
<td width="40%" align="center"><img border="0"
src="/cocoon/samples/images/cocoon.gif"/></td>
<td width="30%" align="center"><font face="arial,helvetica,sanserif"
color="#000000"><b>version
2.1-dev</b></font></td>
</tr>
<tr>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2"
align="center" width="100%">
<tr>
<td width="90%" align="left" bgcolor="#0086b2"><font size="+1"
face="arial,helvetica,sanserif"
color="#ffffff"><xsl:value-of select="page/@title"/></font></td>
<xsl:apply-templates select="page/tab"/>
</tr>
</table>
</tr>
</table>
<table width="100%">
<xsl:apply-templates select="page/row"/>
</table>
<p align="center">
<font size="-1">
Copyright © 1999-2002 <a href="http://www.apache.org/">The Apache
Software Foundation</a>.<br/>
All rights reserved.
</font>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="style">
<link type="text/css" rel="stylesheet" href="[EMAIL PROTECTED]"/>
</xsl:template>
<xsl:template match="script">
<script type="text/javascript" src="[EMAIL PROTECTED]"/>
</xsl:template>
<xsl:template match="tab">
<td nowrap="nowrap" bgcolor="#ffffff"><a href="[EMAIL
PROTECTED]"><i><xsl:value-of select="@title"/></i></a></td>
</xsl:template>
<xsl:template match="row">
<tr>
<xsl:apply-templates select="column"/>
</tr>
</xsl:template>
<xsl:template match="column">
<td valign="top">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0"
width="97%">
<tbody>
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2"
align="center" width="100%">
<tr>
<td bgcolor="#0086b2" width="100%" align="left">
<font size="+1" face="arial,helvetica,sanserif"
color="#ffffff"><xsl:value-of select="@title"/></font>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<xsl:apply-templates/>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</xsl:template>
<xsl:template match="para">
<p align="left">
<i><xsl:apply-templates/></i>
</p>
</xsl:template>
<xsl:template match="@*|node()" priority="-2"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>
<xsl:template match="text()" priority="-1"><xsl:value-of
select="."/></xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/profiler/samples/profile2html.xsl
Index: profile2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:profile="http://apache.org/cocoon/profiler/1.0">
<xsl:param name="sort"/>
<xsl:template match="profile:profilerinfo">
<html>
<head>
<title>Cocoon2 profile information [<xsl:value-of
select="@profile:date"/>]</title>
</head>
<body>
Sort results by <a href="?sort=uri">uri</a>,
<a href="?sort=count">count</a>, <a href="?sort=time">time</a>.
<table noshade="noshade" border="0" cellspacing="1" cellpadding="0"
width="100%">
<xsl:choose>
<xsl:when test="$sort = 'uri'">
<xsl:apply-templates select="profile:pipeline">
<xsl:sort select="@profile:uri"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$sort = 'time'">
<xsl:apply-templates select="profile:pipeline">
<xsl:sort select="@profile:time" data-type="number"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$sort = 'count'">
<xsl:apply-templates select="profile:pipeline">
<xsl:sort select="@profile:count" data-type="number"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</table>
<xsl:apply-templates
select="profile:pipeline/profile:result/profile:environmentinfo"/>
</body>
</html>
</xsl:template>
<xsl:template match="profile:pipeline">
<xsl:if test="position() mod 5 = 1">
<tr bgcolor="#FFC0C0">
<th>NN</th>
<th>Role (Source)</th>
<th>Average</th>
<th colspan="10">Last Results</th>
</tr>
</xsl:if>
<tr bgcolor="#C0C0FF">
<td colspan="3">
<a href="[EMAIL PROTECTED]:key}">
<font face="verdana"><strong><xsl:value-of
select="@profile:uri"/></strong></font>
(<xsl:value-of select="@profile:count"/> results,
total time: <xsl:value-of select="@profile:time"/>,
average time: <xsl:value-of select="@profile:time div
@profile:count"/>)
</a>
</td>
<xsl:for-each select="profile:result">
<td>
<a href="?key={../@profile:key}&[EMAIL PROTECTED]:index}">
<xsl:value-of select="@profile:index"/>
</a>
</td>
</xsl:for-each>
</tr>
<xsl:for-each select="profile:average/profile:component">
<xsl:variable name="bgcolor">
<xsl:if test="position() mod 2 = 0">#D0D0D0</xsl:if>
<xsl:if test="position() mod 2 = 1">#E0E0E0</xsl:if>
</xsl:variable>
<tr bgcolor="{$bgcolor}">
<xsl:variable name="pos" select="position()"/>
<td width="1%">
<xsl:value-of select="$pos"/>
</td>
<td width="10%">
<xsl:value-of select="@profile:role"/>
<xsl:if test="@profile:source">
(<xsl:value-of select="@profile:source"/>)
</xsl:if>
</td>
<xsl:for-each
select="../../profile:average/profile:component[position()=$pos]">
<th>
<xsl:value-of select="@profile:time"/>
</th>
</xsl:for-each>
<xsl:for-each
select="../../profile:result/profile:component[position()=$pos]">
<td>
<a
href="?key={../../@profile:key}&index={../@profile:index}&[EMAIL
PROTECTED]:offset}">
<xsl:value-of select="@profile:time"/>
</a>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
<xsl:variable name="pos"
select="count(profile:average/profile:component)"/>
<tr>
<td width="1%">
<xsl:value-of select="$pos+1"/>
</td>
<td width="10%">
TOTAL
</td>
<th>
<xsl:value-of select="profile:average/@profile:time"/>
</th>
<xsl:for-each select="profile:result">
<td>
<xsl:value-of select="@profile:time"/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="profile:average|profile:result">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="profile:component">
<table cellspacing="0" cellpadding="0">
<tr>
<td>
<xsl:value-of select="@profile:role"/>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="profile:environmentinfo">
<xsl:apply-templates select="profile:request-parameters"/>
<xsl:apply-templates select="profile:session-attributes"/>
</xsl:template>
<xsl:template match="profile:request-parameters">
<table>
<tr bgcolor="#C0C0FF">
<th colspan="14">
Request parameters
</th>
</tr>
<tr bgcolor="#FFC0C0">
<th>Name</th>
<th>Value</th>
</tr>
<xsl:for-each select="profile:parameter">
<xsl:variable name="bgcolor">
<xsl:if test="position() mod 2 = 0">#D0D0D0</xsl:if>
<xsl:if test="position() mod 2 = 1">#E0E0E0</xsl:if>
</xsl:variable>
<tr bgcolor="{$bgcolor}">
<td><xsl:value-of select="@profile:name"/></td>
<td><xsl:value-of select="@profile:value"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="profile:session-attributes">
<table>
<tr bgcolor="#C0C0FF">
<th colspan="14">
Session attributes
</th>
</tr>
<tr bgcolor="#FFC0C0">
<th>Name</th>
<th>Value</th>
</tr>
<xsl:for-each select="profile:attribute">
<xsl:variable name="bgcolor">
<xsl:if test="position() mod 2 = 0">#D0D0D0</xsl:if>
<xsl:if test="position() mod 2 = 1">#E0E0E0</xsl:if>
</xsl:variable>
<tr bgcolor="{$bgcolor}">
<td><xsl:value-of select="@profile:name"/></td>
<td><xsl:value-of select="@profile:value"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/profiler/samples/profile2page.xsl
Index: profile2page.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:profile="http://apache.org/cocoon/profiler/1.0">
<xsl:import href="xml2html.xsl"/>
<xsl:output indent="yes"/>
<xsl:param name="key"/>
<xsl:param name="result"/>
<xsl:param name="component"/>
<xsl:template match="/">
<page>
<tab title="Back" href="profile.html"/>
<tab title="Overview" href="welcome"/>
<style href="xml2html.css"/>
<script href="xml2html.js"/>
<xsl:choose>
<xsl:when test="$component!=''">
<xsl:apply-templates
select="profile:profilerinfo/profile:pipeline/profile:result/profile:[EMAIL
PROTECTED]:index=$component]"
mode="fragment"/>
</xsl:when>
<xsl:when test="$result!=''">
<xsl:apply-templates
select="profile:profilerinfo/profile:pipeline/profile:result" mode="result"/>
</xsl:when>
<xsl:when test="$key!=''">
<xsl:apply-templates select="profile:profilerinfo/profile:pipeline"
mode="results"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="profile:profilerinfo" mode="pipelines"/>
</xsl:otherwise>
</xsl:choose>
</page>
</xsl:template>
<xsl:template match="profile:profilerinfo" mode="pipelines">
<row>
<column title="Overview">
<table width="100%" cellspacing="0" cellpadding="5" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left"><b>URI</b></td>
<td align="left"><b>Average(Total time)</b></td>
<td align="left" colspan="10"><b>Last Results(Total time)</b></td>
</tr>
<xsl:for-each select="profile:pipeline">
<tr bgcolor="#FFFFFF">
<td>
<a href="[EMAIL PROTECTED]:key}">
<font face="verdana"><strong><xsl:value-of
select="@profile:uri"/></strong></font>
</a>
</td>
<td>
<a href="[EMAIL PROTECTED]:key}">
<xsl:value-of select="profile:average/@profile:time"/> ms
</a>
</td>
<xsl:for-each select="profile:result">
<td>
<a href="?key={../@profile:key}&[EMAIL PROTECTED]:index}">
<xsl:value-of select="@profile:time"/> ms
</a>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</font>
</table>
</column>
</row>
</xsl:template>
<xsl:template match="profile:pipeline" mode="results">
<row>
<column title="[EMAIL PROTECTED]:uri}">
<table width="100%" cellspacing="0" cellpadding="5" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left"><b>NN</b></td>
<td align="left"><b>Components(Role)</b></td>
<td align="left"><b>Average time</b></td>
<td align="left"><b>Lastest times</b></td>
</tr>
<xsl:for-each select="profile:average/profile:component">
<tr>
<xsl:variable name="pos" select="position()"/>
<td width="1%">
<xsl:value-of select="$pos"/>
</td>
<td width="10%">
<xsl:value-of select="@profile:role"/>
<xsl:if test="@profile:source">
(<xsl:value-of select="@profile:source"/>)
</xsl:if>
</td>
<xsl:for-each
select="../../profile:average/profile:component[position()=$pos]">
<td>
<xsl:value-of select="@profile:time"/> ms
</td>
</xsl:for-each>
<xsl:for-each
select="../../profile:result/profile:component[position()=$pos]">
<td>
<a
href="?key={../../@profile:key}&result={../@profile:index}&[EMAIL
PROTECTED]:index}">
<xsl:value-of select="@profile:time"/> ms
</a>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
<tr>
<td></td>
<td><b>Total time</b></td>
<td><b><xsl:value-of select="profile:result/@profile:time"/>
ms</b></td>
<xsl:for-each select="profile:result">
<td>
<b>
<xsl:value-of select="@profile:time"/> ms
</b>
</td>
</xsl:for-each>
</tr>
</font>
</table>
</column>
</row>
</xsl:template>
<xsl:template match="profile:result" mode="result">
<row>
<column title="{../@profile:uri}">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td align="left"><b>Components</b></td>
<td align="left"><b>Time</b></td>
</tr>
<xsl:for-each select="profile:component">
<tr>
<td>
<a
href="?key={../../@profile:key}&result={../@profile:index}&[EMAIL
PROTECTED]:index}">
<xsl:value-of select="@profile:role"/>
<xsl:if test="@profile:source">
(<xsl:value-of select="@profile:source"/>)
</xsl:if>
</a>
</td>
<td>
<xsl:value-of select="@profile:time"/> ms
</td>
</tr>
</xsl:for-each>
</table>
</column>
</row>
<row>
<column title="Request parameters">
<table width="100%" cellspacing="0" cellpadding="5" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left"><b>Name</b></td>
<td align="left"><b>Value</b></td>
</tr>
<xsl:for-each
select="profile:environmentinfo/profile:request-parameters/profile:parameter">
<tr>
<td><xsl:value-of select="@profile:name"/></td>
<td><xsl:value-of select="@profile:value"/></td>
</tr>
</xsl:for-each>
<tr>
<td> </td>
<td> </td>
</tr>
</font>
</table>
</column>
</row>
<row>
<column title="Session attributes">
<table width="100%" cellspacing="0" cellpadding="5" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left"><b>Name</b></td>
<td align="left"><b>Value</b></td>
</tr>
<xsl:for-each
select="profile:environmentinfo/profile:session-attributes/profile:attribute">
<tr>
<td><xsl:value-of select="@profile:name"/></td>
<td><xsl:value-of select="@profile:value"/></td>
</tr>
</xsl:for-each>
<tr>
<td> </td>
<td> </td>
</tr>
</font>
</table>
</column>
</row>
</xsl:template>
<xsl:template match="profile:component" mode="fragment">
<row>
<column>
<xsl:attribute name="title">
<xsl:value-of select="@profile:role"/>
<xsl:if test="@profile:source">
(<xsl:value-of select="@profile:source"/>)
</xsl:if>
</xsl:attribute>
<xsl:choose>
<xsl:when test="profile:fragment">
<xsl:for-each select="profile:fragment">
<xsl:apply-templates mode="xml2html"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<b>Fragment not available!</b>
</xsl:otherwise>
</xsl:choose>
</column>
</row>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/profiler/samples/samples.xml
Index: samples.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Main examples page.">
<sample name="Back" href="..">to Cocoon examples main page</sample>
</group>
<group name="Test">
<sample name="Caching test site" href="caching-testsite.html">A simple test
side perform the profiling. Is show
the current sitemap.</sample>
<sample name="Non Caching test site" href="noncaching-testsite.html">The
same site, but this will not be cached.</sample>
</group>
<group name="Profiler">
<sample name="Profiler Result" href="profile.html">Shows the result of the
profiler.</sample>
<sample name="Profiler Result 2" href="profile2.html">Another view of the
results.</sample>
<sample name="XML Output" href="profile.xml">Show source xml code of the
profiler generator.</sample>
</group>
</samples>
1.1 xml-cocoon2/src/blocks/profiler/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators default="file">
</map:generators>
<map:transformers default="xslt">
</map:transformers>
<map:readers default="resource">
</map:readers>
<map:serializers default="html">
</map:serializers>
<map:matchers default="wildcard">
</map:matchers>
<map:selectors default="browser">
</map:selectors>
<map:actions>
</map:actions>
<map:pipes default="caching">
</map:pipes>
</map:components>
<!-- =========================== Pipelines =================================
-->
<map:pipelines>
<!-- =========================== Cacheable =================================
-->
<map:pipeline type="profile-caching">
<map:match pattern="caching-testsite.html">
<map:generate src="test.xml"/>
<map:transform src="test2page.xsl"/>
<map:transform src="page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:handle-errors>
<map:transform
src="context://samples/common/style/xsl/html/error2html.xsl"/>
<map:serialize type="html" status-code="500"/>
</map:handle-errors>
</map:pipeline>
<!-- =========================== Noncacheable
================================= -->
<map:pipeline type="profile-noncaching">
<map:match pattern="noncaching-testsite.html">
<map:generate src="test.xml"/>
<map:transform src="test2page.xsl"/>
<map:transform src="page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:handle-errors>
<map:transform
src="context://samples/common/style/xsl/html/error2html.xsl"/>
<map:serialize type="html" status-code="500"/>
</map:handle-errors>
</map:pipeline>
<!-- =========================== Profiler =================================
-->
<map:pipeline type="caching">
<map:match pattern="">
<map:redirect-to uri="welcome"/>
</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:match>
<map:match pattern="profile.html">
<map:generate type="profiler"/>
<map:transform src="profile2page.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:transform src="page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="profile2.html">
<map:generate type="profiler"/>
<map:transform src="profile2html.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
<map:match pattern="profile.xml">
<map:generate type="profiler"/>
<map:transform
src="context://samples/common/style/xsl/html/simple-xml2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="*.css">
<map:read src="{1}.css" mime-type="text/css"/>
</map:match>
<map:match pattern="*.js">
<map:read src="{1}.js" mime-type="text/javascript"/>
</map:match>
<map:handle-errors>
<map:transform
src="context://samples/common/style/xsl/html/error2html.xsl"/>
<map:serialize type="html" status-code="500"/>
</map:handle-errors>
</map:pipeline>
</map:pipelines>
</map:sitemap>
1.1 xml-cocoon2/src/blocks/profiler/samples/test.xml
Index: test.xml
===================================================================
<hello-world>
<title>Title of the example</title>
<some-text>This is a litte test file!</some-text>
<some-text>And will transformed into a HTML page.</some-text>
</hello-world>
1.1 xml-cocoon2/src/blocks/profiler/samples/test2page.xsl
Index: test2page.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="hello-world">
<page>
<tab title="Overview" href="welcome"/>
<row>
<column title="{title}">
<xsl:apply-templates select="some-text"/>
</column>
</row>
</page>
</xsl:template>
<xsl:template match="some-text">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/blocks/profiler/samples/xml2html.css
Index: xml2html.css
===================================================================
BODY {font:x-small 'Verdana'; margin-right:1.5em}
.c {cursor:hand}
.b {color:red; font-family:'Courier New'; font-weight:bold;
text-decoration:none}
.e {margin-left:1em; text-indent:-1em; margin-right:1em}
.k {margin-left:1em; text-indent:-1em; margin-right:1em}
.t {color:#990000}
.xt {color:#990099}
.ns {color:red}
.dt {color:green}
.m {color:blue}
.tx {font-weight:bold}
.db {text-indent:0px; margin-left:1em; margin-top:0px;
margin-bottom:0px;padding-left:.3em;
border-left:1px solid #CCCCCC; font:small Courier}
.di {font:small Courier}
.d {color:blue}
.pi {color:blue}
.cb {text-indent:0px; margin-left:1em; margin-top:0px;
margin-bottom:0px;padding-left:.3em; font:small Courier;
color:#888888}
.ci {font:small Courier; color:#888888}
PRE {margin:0px; display:inline}
1.1 xml-cocoon2/src/blocks/profiler/samples/xml2html.js
Index: xml2html.js
===================================================================
//MSIE
function f(e){
if (e.className=="ci") {
if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"cb");
}
if (e.className=="di") {
if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"db");
} e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
k=j.children(0);
k.style.visibility="visible";
k.href="#";
}
function ch(e) {
mark=e.children(0).children(0);
if (mark.innerText=="+") {
mark.innerText="-";
for (var i=1;i<e.children.length;i++) {
e.children(i).style.display="block";
}
}
else if (mark.innerText=="-") {
mark.innerText="+";
for (var i=1;i<e.children.length;i++) {
e.children(i).style.display="none";
}
}
}
function ch2(e) {
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText=="+") {
mark.innerText="-";
if (contents.className=="db"||contents.className=="cb") {
contents.style.display="block";
}
else {
contents.style.display="inline";
}
}
else if (mark.innerText=="-") {
mark.innerText="+";
contents.style.display="none";
}
}
function cl() {
e=window.event.srcElement;
if (e.className!="c") {
e=e.parentElement;
if (e.className!="c") {
return;
}
}
e=e.parentElement;
if (e.className=="e") {
ch(e);
}
if (e.className=="k") {
ch2(e);
}
}
//mozilla
function moz_f(){
clean=document.getElementsByName('clean');
for(i=0; i<clean.length;i++)
{
e = clean[i];
if (e.className=="ci") {
if
(e.childNodes[1].childNodes[0].nodeValue.indexOf("\n")>0)
moz_fix(e,"cb");
}
if (e.className=="di") {
if (e.childNodes[1].nodeValue.indexOf("\n")>0)
moz_fix(e,"db");
}
}
}
function moz_fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentNode.childNodes[1];
j.className="c";
k=j.childNodes[0];
k.style.visibility="visible";
k.href="#";
}
function moz_ch(e) {
mark = e.childNodes[1].childNodes[1];
if (mark.childNodes[0].nodeValue=="+") {
mark.childNodes[0].nodeValue="-";
for (var i=2;i<e.childNodes.length;i++) {
if(e.childNodes[i].nodeName != "#text")
e.childNodes[i].style.display="block";
}
}
else if (mark.childNodes[0].nodeValue=="-") {
mark.childNodes[0].nodeValue="+";
for (var i=2;i<e.childNodes.length;i++) {
if(e.childNodes[i].nodeName != "#text")
e.childNodes[i].style.display="none";
}
}
}
function moz_ch2(e) {
mark = e.childNodes[1].childNodes[0];
contents=e.childNodes[2];
if (mark.childNodes[0].nodeValue=="+") {
mark.childNodes[0].nodeValue="-";
if (contents.className=="db"||contents.className=="cb") {
contents.style.display="block";
}
else {
contents.style.display="inline";
}
}
else if (mark.childNodes[0].nodeValue=="-") {
mark.childNodes[0].nodeValue="+";
contents.style.display="none";
}
}
function moz_cl(evnt) {
e=evnt.target.parentNode;
if (e.className != "c") {
e=e.parentNode
if (e.className!="c") {
return;
}
}
e=e.parentNode
if (e.className=="e") {
moz_ch(e);
}
if (e.className=="k") {
moz_ch2(e);
}
}
function ex(){}
function h(){window.status=" ";}
if(document.all)
document.onclick=cl;
else if(document.getElementById)
document.onclick=moz_cl;
1.1 xml-cocoon2/src/blocks/profiler/samples/xml2html.xsl
Index: xml2html.xsl
===================================================================
<!--
|
| XSLT REC Compliant Version of IE5 Default Stylesheet
|
| Original version by Jonathan Marsh ([EMAIL PROTECTED])
| http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl
|
| Conversion to XSLT 1.0 REC Syntax by Steve Muench ([EMAIL PROTECTED])
| Added script support by Andrew Timberlake ([EMAIL PROTECTED])
|
+-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="processing-instruction()" mode="xml2html">
<DIV class="e">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><?</xsl:text>
</SPAN>
<SPAN class="pi">
<xsl:value-of select="name(.)"/>
<xsl:value-of select="."/>
</SPAN>
<SPAN class="m">
<xsl:text>?></xsl:text>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="processing-instruction('xml')" mode="xml2html">
<DIV class="e">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><?</xsl:text>
</SPAN>
<SPAN class="pi">
<xsl:text>xml </xsl:text>
<xsl:for-each select="@*">
<xsl:value-of select="name(.)"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>" </xsl:text>
</xsl:for-each>
</SPAN>
<SPAN class="m">
<xsl:text>?></xsl:text>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="@*" mode="xml2html">
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*/@*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">="</SPAN>
<B>
<xsl:value-of select="."/>
</B>
<SPAN class="m">"</SPAN>
<xsl:if test="position()!=last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="xml2html">
<DIV class="e">
<SPAN class="b"> </SPAN>
<SPAN class="tx">
<xsl:value-of select="."/>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="comment()" mode="xml2html">
<DIV class="k">
<SPAN>
<A STYLE="visibility:hidden" class="b" onclick="return false"
onfocus="h()">-</A>
<SPAN class="m">
<xsl:text><!--</xsl:text>
</SPAN>
</SPAN>
<SPAN class="ci" id="clean">
<PRE>
<xsl:value-of select="."/>
</PRE>
</SPAN>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text>--></xsl:text>
</SPAN>
<SCRIPT>if(document.all)f(clean);</SCRIPT>
</DIV>
</xsl:template>
<xsl:template match="*" mode="xml2html">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*" mode="xml2html"/>
<SPAN class="m">
<xsl:text>/></xsl:text>
</SPAN>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[node()]" mode="xml2html">
<DIV class="e">
<DIV class="c">
<A class="b" href="#" onclick="return false" onfocus="h()">-</A>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*" mode="xml2html"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
<DIV>
<xsl:apply-templates mode="xml2html"/>
<DIV>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text></</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[text() and not (comment() or
processing-instruction())]" mode="xml2html">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*" mode="xml2html"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
<SPAN class="tx">
<xsl:value-of select="."/>
</SPAN>
<SPAN class="m"></</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[*]" priority="20" mode="xml2html">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em" class="c">
<A class="b" href="#" onclick="return false" onfocus="h()">-</A>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*" mode="xml2html"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
<DIV>
<xsl:apply-templates mode="xml2html"/>
<DIV>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text></</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</DIV>
</xsl:template>
<xsl:template name="nbsp-ref">
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
1.39 +1 -6 xml-cocoon2/src/webapp/samples/samples.xml
Index: samples.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/samples.xml,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- samples.xml 31 Jan 2003 18:48:26 -0000 1.38
+++ samples.xml 31 Jan 2003 19:20:04 -0000 1.39
@@ -149,11 +149,6 @@
Verify that there are no broken hyperlinks in the Cocoon documentation.
</sample>
</group>
- <group name="JSP with Cocoon">
- <sample name="JSP samples" href="jsp/">
- JSP usage with Cocoon
- </sample>
- </group>
<group name="More Samples">
<sample name="Static Content" href="sample-static">
How to produce different type of static content.
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]