cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/webapp/samples/slide README login-failed.html login.html logout.html rdf2html.xsl sitemap.xmap slide.xconf web.xml
Date Mon, 01 Jul 2002 15:09:21 GMT
cziegeler    2002/07/01 08:09:21

  Added:       src/scratchpad/webapp/samples/castor sitemap.xmap test.xml
               src/scratchpad/webapp/samples/castor/castor-mappings
                        test-mapping.xml test-mapping_de.xml
               src/scratchpad/webapp/samples/castor/doc
                        castortransformer.xml
               src/scratchpad/webapp/samples/chaperon sitemap.xmap
               src/scratchpad/webapp/samples/chaperon/grammars java.rgrm
                        mathexp.grm rgrm.grm wiki.grm wiki.rgrm
               src/scratchpad/webapp/samples/chaperon/misc index.html
                        java.css matex.xsp mathexp.xsp test2.java wiki.xsp
               src/scratchpad/webapp/samples/chaperon/stylesheets
                        java2html.xsl mathexp2html.xsl parsefragment.xsl
                        rgrm2grm.xsl wiki2html.xsl
               src/scratchpad/webapp/samples/charts sitemap.xmap
               src/scratchpad/webapp/samples/charts/content samples.xml
               src/scratchpad/webapp/samples/charts/content/static
                        bar3Dchart.xml barchart.xml linechart.xml
                        testapplet.xml
               src/scratchpad/webapp/samples/charts/content/static/bar
                        bar1.xml bar10.xml bar11.xml bar12.xml bar2.xml
                        bar3.xml bar4.xml bar5.xml bar6.xml bar7.xml
                        bar8.xml bar9.xml
               src/scratchpad/webapp/samples/charts/content/static/line
                        line1.xml line2.xml line3.xml line4.xml line5.xml
                        line6.xml
               src/scratchpad/webapp/samples/charts/content/static/multi
                        multi1.xml
               src/scratchpad/webapp/samples/charts/content/static/pie
                        pie1.xml pie2.xml pie3.xml pie4.xml pie5.xml
                        pie6.xml pie7.xml
               src/scratchpad/webapp/samples/charts/stylesheets
                        simple-samples2html.xsl
               src/scratchpad/webapp/samples/editor README sitemap.xmap
                        test.xmap
               src/scratchpad/webapp/samples/editor/docs source.xml
                        tests.xml welcome.xml
               src/scratchpad/webapp/samples/editor/editor/docs
                        alpha-config.xml bravo-config.xml
                        schematron-page.xml slash-edit.css template.xml
                        welcome.xml
               src/scratchpad/webapp/samples/editor/editor/images dir.gif
                        file.gif get.gif new.gif see.gif
               src/scratchpad/webapp/samples/editor/editor/stylesheets
                        dir2editor.xsl editor-alpha-components.xsl
                        editor-bravo-components.xsl editor-components.xsl
                        editor-page2html.xsl editor-utils.xsl
                        editor2writer.xsl file2editor.xsl
                        generation-utils.xsl request2editor.xsl
                        schematron-extensions.xsl
                        schematron-validator2xsl.xsl
                        schematron-wrappers.xsl simple-page2html.xsl
                        stream2editor.xsl validationFilter.xsl
               src/scratchpad/webapp/samples/editor/stylesheets
                        simple-page2html.xsl
               src/scratchpad/webapp/samples/editor/tests include-me.xml
                        make-page.xsl result7.xml result8.xml test1.xml
                        test2.xml test3.xml test4.xml test5.xml test7.xml
                        test8.xml
               src/scratchpad/webapp/samples/editor/tests/test6 inc.xsl
                        input.xml prepareWrite.xsl
               src/scratchpad/webapp/samples/editor/tests/test9 inc.xsl
                        input.xml prepareWrite.xsl
               src/scratchpad/webapp/samples/paginator README.txt
                        sitemap.xmap
               src/scratchpad/webapp/samples/paginator/content list.xml
               src/scratchpad/webapp/samples/paginator/pagesheets
                        list.pagesheet pagesheet.dtd
               src/scratchpad/webapp/samples/paginator/stylesheets
                        list2html.xsl pagedlist2html.xsl
               src/scratchpad/webapp/samples/precept README sitemap.xmap
                        snippet.roles snippet.xconf
               src/scratchpad/webapp/samples/precept/example1 README
                        error.xml error.xsl thanks.xml thanks.xsl view1.xml
                        view1.xsl view2.xml view2.xsl view3.xml view3.xsl
                        view4.xml view4.xsl
               src/scratchpad/webapp/samples/precept/example2 README
                        error.xml i2html.xsl thanks.xml view1.xml view2.xml
                        view3.xml view4.xml
               src/scratchpad/webapp/samples/precept/model easyrelax.xml
               src/scratchpad/webapp/samples/slide README login-failed.html
                        login.html logout.html rdf2html.xsl sitemap.xmap
                        slide.xconf web.xml
  Removed:     src/scratchpad/webapp/mount/castor sitemap.xmap test.xml
               src/scratchpad/webapp/mount/castor/castor-mappings
                        test-mapping.xml test-mapping_de.xml
               src/scratchpad/webapp/mount/castor/doc castortransformer.xml
               src/scratchpad/webapp/mount/chaperon sitemap.xmap
               src/scratchpad/webapp/mount/chaperon/grammars java.rgrm
                        mathexp.grm rgrm.grm wiki.grm wiki.rgrm
               src/scratchpad/webapp/mount/chaperon/misc index.html
                        java.css matex.xsp mathexp.xsp test2.java wiki.xsp
               src/scratchpad/webapp/mount/chaperon/stylesheets
                        java2html.xsl mathexp2html.xsl parsefragment.xsl
                        rgrm2grm.xsl wiki2html.xsl
               src/scratchpad/webapp/mount/charts sitemap.xmap
               src/scratchpad/webapp/mount/charts/content samples.xml
               src/scratchpad/webapp/mount/charts/content/static
                        bar3Dchart.xml barchart.xml linechart.xml
                        testapplet.xml
               src/scratchpad/webapp/mount/charts/content/static/bar
                        bar1.xml bar10.xml bar11.xml bar12.xml bar2.xml
                        bar3.xml bar4.xml bar5.xml bar6.xml bar7.xml
                        bar8.xml bar9.xml
               src/scratchpad/webapp/mount/charts/content/static/line
                        line1.xml line2.xml line3.xml line4.xml line5.xml
                        line6.xml
               src/scratchpad/webapp/mount/charts/content/static/multi
                        multi1.xml
               src/scratchpad/webapp/mount/charts/content/static/pie
                        pie1.xml pie2.xml pie3.xml pie4.xml pie5.xml
                        pie6.xml pie7.xml
               src/scratchpad/webapp/mount/charts/stylesheets
                        simple-samples2html.xsl
               src/scratchpad/webapp/mount/editor README editor.xmap
                        sitemap.xmap test.xmap
               src/scratchpad/webapp/mount/editor/docs source.xml tests.xml
                        welcome.xml
               src/scratchpad/webapp/mount/editor/editor/docs
                        alpha-config.xml bravo-config.xml
                        schematron-page.xml slash-edit.css template.xml
                        welcome.xml
               src/scratchpad/webapp/mount/editor/editor/images dir.gif
                        file.gif get.gif new.gif see.gif
               src/scratchpad/webapp/mount/editor/editor/stylesheets
                        dir2editor.xsl editor-alpha-components.xsl
                        editor-bravo-components.xsl editor-components.xsl
                        editor-page2html.xsl editor-utils.xsl
                        editor2writer.xsl file2editor.xsl
                        generation-utils.xsl request2editor.xsl
                        schematron-extensions.xsl
                        schematron-validator2xsl.xsl
                        schematron-wrappers.xsl simple-page2html.xsl
                        stream2editor.xsl validationFilter.xsl
               src/scratchpad/webapp/mount/editor/stylesheets
                        simple-page2html.xsl
               src/scratchpad/webapp/mount/editor/tests include-me.xml
                        make-page.xsl result7.xml result8.xml test1.xml
                        test2.xml test3.xml test4.xml test5.xml test7.xml
                        test8.xml
               src/scratchpad/webapp/mount/editor/tests/test6 inc.xsl
                        input.xml prepareWrite.xsl
               src/scratchpad/webapp/mount/editor/tests/test9 inc.xsl
                        input.xml prepareWrite.xsl
               src/scratchpad/webapp/mount/paginator README.txt
                        sitemap.xmap
               src/scratchpad/webapp/mount/paginator/content list.xml
               src/scratchpad/webapp/mount/paginator/pagesheets
                        list.pagesheet pagesheet.dtd
               src/scratchpad/webapp/mount/paginator/stylesheets
                        list2html.xsl pagedlist2html.xsl
               src/scratchpad/webapp/mount/precept README sitemap.xmap
                        snippet.roles snippet.xconf
               src/scratchpad/webapp/mount/precept/example1 README
                        error.xml error.xsl thanks.xml thanks.xsl view1.xml
                        view1.xsl view2.xml view2.xsl view3.xml view3.xsl
                        view4.xml view4.xsl
               src/scratchpad/webapp/mount/precept/example2 README
                        error.xml i2html.xsl thanks.xml view1.xml view2.xml
                        view3.xml view4.xml
               src/scratchpad/webapp/mount/precept/model easyrelax.xml
               src/scratchpad/webapp/mount/slide README login-failed.html
                        login.html logout.html rdf2html.xsl sitemap.xmap
                        slide.xconf web.xml
  Log:
  Moved all samples from mount to samples
  
  Revision  Changes    Path
  1.3       +1 -1      xml-cocoon2/src/scratchpad/webapp/samples/castor/sitemap.xmap
  
  
  
  
  1.3       +0 -0      xml-cocoon2/src/scratchpad/webapp/samples/castor/test.xml
  
  
  
  
  1.3       +0 -0      xml-cocoon2/src/scratchpad/webapp/samples/castor/castor-mappings/test-mapping.xml
  
  
  
  
  1.3       +0 -0      xml-cocoon2/src/scratchpad/webapp/samples/castor/castor-mappings/test-mapping_de.xml
  
  
  
  
  1.3       +0 -0      xml-cocoon2/src/scratchpad/webapp/samples/castor/doc/castortransformer.xml
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/chaperon/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:pipelines default="caching">
     <map:pipeline name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
     <map:pipeline name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>
    </map:pipelines>
  
   </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="index.html"/>
     </map:match>
  
     <!-- ========================= Chaperon ================================ -->
  
     <map:match pattern="index.html">
      <map:read src="misc/index.html"/>
     </map:match>
  
     <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="java.html">
      <map:generate type="textparser" src="misc/test2.java">
       <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/scratchpad/webapp/samples/chaperon/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.
   *
   * Bronikov@inreach.com
   *
   *------------------------------------------------------------------
   *
   * 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/scratchpad/webapp/samples/chaperon/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="&#10;&#13;&#9;&#32;"/></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/scratchpad/webapp/samples/chaperon/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="&lt;"/>
    </token>
  
    <token tsymbol="abclose">
     <string content=">"/>
    </token>
  
    <token tsymbol="string">
     <concat>
      <string content="&#34;"/>
      <alt minOccurs="1" maxOccurs="*">
       <ncc><cs content="&#92;&#34;"/></ncc>
       <concat><string content="&#92;"/><ncc><cs content="u"/></ncc></concat>
       <concat>
        <string content="&#92;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="&#34;"/>
     </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="&#92;[]-&#10;&#13;&#32;();%[]|+?*^$&lt;>&#34;"/></ncc>
      <!--<concat><string content="&#92;"/><dot/></concat>
      <concat><string content="&#92;"/><ncc><cs content="u"/></ncc></concat>
  		<concat>
       <string content="&#92;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="&#92;"/><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="&#10;"/></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="&#10;&#13;&#9;&#32;"/></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/scratchpad/webapp/samples/chaperon/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="&quot;"/>
  </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="&#10;"/>
  <concat maxOccurs="*" minOccurs="0">
  <cc>
  <cs content=" "/>
  <cs content="	"/>
  </cc>
  </concat>
  <string content="&#10;"/>
  </concat>
  <concat>
  <string content="&#13;"/>
  <concat maxOccurs="*" minOccurs="0">
  <cc>
  <cs content=" "/>
  <cs content="	"/>
  </cc>
  </concat>
  <string content="&#13;"/>
  </concat>
  <concat>
  <string content="&#10;"/>
  <concat maxOccurs="*" minOccurs="0">
  <cc>
  <cs content=" "/>
  <cs content="	"/>
  </cc>
  </concat>
  <string content="&#10;"/>
  </concat>
  </alt>
  </token>
  <token tsymbol="EOL">
  <alt>
  <concat>
  <string content="&#13;"/>
  <concat maxOccurs="1" minOccurs="0">
  <string content="&#10;"/>
  </concat>
  </concat>
  <string content="&#10;"/>
  </alt>
  </token>
  </tokens>
   <ignorabletokens>
    <token tsymbol="whitespace">
  <concat maxOccurs="*" minOccurs="1">
  <cc>
  <cs content=" "/>
  <cs content="&#13;"/>
  <cs content="&#10;"/>
  </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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/misc/index.html
  
  Index: index.html
  ===================================================================
  <?xml version="1.0" encoding="ASCII"?>
  <html>
   <head>
    <title>Chaperon Examples</title>
   </head>
   <body>
  
    <h1>Chaperon Examples</h1>
  
    <p>
     <ul>
      <li><a href="mathexp.html">Mathexp example</a></li>
      <li><a href="wiki.html">Wiki Example</a></li>
      <li><a href="java.html">Java Example (Need once 2-3min, for the parser table generation process)</a></li>
     </ul>
    </p>
  
   </body>
  </html>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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 &quot;some italic text I hope &quot;. 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/scratchpad/webapp/samples/chaperon/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%">&#160;</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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/chaperon/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">&#10;</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">&#13;</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">&#9;</xsl:text></xsl:attribute>
      </xsl:when>
      <xsl:when test="contains(.,'\ ')">
       <xsl:attribute name="content"><xsl:text disable-output-escaping="yes">&#32;</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">&#10;</xsl:text>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'r'">
       <xsl:text disable-output-escaping="yes">&#13;</xsl:text>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 't'">
       <xsl:text disable-output-escaping="yes">&#9;</xsl:text>
      </xsl:when>
      <xsl:when test="contains(.,'\ ')">
       <xsl:text disable-output-escaping="yes">&#32;</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/scratchpad/webapp/samples/chaperon/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/scratchpad/webapp/samples/charts/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:transformers default="xslt">
     <map:transformer label="transformed" name="chart2svg" src="org.apache.cocoon.transformation.Chart2SvgTransformer"/>
     <map:transformer name="wings" src="org.apache.cocoon.transformation.WingsTransformer" />
    </map:transformers>
    
    <map:readers default="resource"/>
    
    <map:serializers default="html">
       <map:serializer name="svgxml" mime-type="image/svg-xml"    logger="sitemap.serializer.svgxml"
                     src="org.apache.cocoon.serialization.XMLSerializer">
      <doctype-public>-//W3C//DTD SVG 20000303 Stylable//EN</doctype-public>
      <doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system>
     </map:serializer>
    </map:serializers>
    
    <map:matchers default="wildcard"/>
    
    <map:selectors default="browser"/>
    
   <map:views>
  	  <map:view name="transformed" from-label="transformed">
  	   <map:serialize type="xml"/>
  	  </map:view>
   </map:views>
    
    
   </map:components>
  
   <map:pipelines>
    <map:pipeline>
    
     <map:match pattern="">
      <map:redirect-to uri="welcome"/>
     </map:match>
  
     <map:match pattern="welcome">
      <map:generate src="content/samples.xml"/>
      <map:transform src="stylesheets/simple-samples2html.xsl"/>
      <map:serialize/>
     </map:match>
     
     <map:match pattern="*/*.xml">
     		<map:generate src="content/static/{1}/{2}.xml" />
  		<map:transform type="wings" />
  		<map:serialize type="xml" />
     </map:match>
     
     <map:match pattern="*/*.svg">
     		<map:generate src="content/static/{1}/{2}.xml" />
  		<map:transform type="wings" />
  		<map:serialize type="svgxml" />
     </map:match>
  
     <map:match pattern="*/*.jpg">
     		<map:generate src="content/static/{1}/{2}.xml" />
  		<map:transform type="wings" />
  		<map:serialize type="svg2jpeg" />
     </map:match>   
     
     
     <map:match pattern="*chart.xml">
      <map:generate src="content/static/{1}chart.xml"/>
      <map:transform type="chart2svg"/>
      <map:serialize type="xml"/>
     </map:match>
     
     <map:match pattern="*chart.svg">
      <map:generate src="content/static/{1}chart.xml"/>
      <map:transform type="chart2svg"/>
      <map:serialize type="svgxml"/>
     </map:match>
  
     <map:match pattern="*chart.source.xml">
      <map:generate src="content/static/{1}chart.xml"/>
      <map:serialize type="xml"/>
     </map:match>   
     
     <!-- ========================= Server ================================ -->
  
     <map:match pattern="sites/styles/**.css">
      <map:read src="resources/styles/{1}.css" mime-type="text/css"/>
     </map:match>
  
     <map:match pattern="images/**.gif">
      <map:read src="resources/images/{1}.gif" mime-type="image/gif"/>
     </map:match>
  
     <map:match pattern="images/**.jpg">
      <map:read src="resources/images/{1}.jpg" mime-type="image/jpg"/>
     </map:match>
  
     <map:match pattern="images/**.png">
      <map:read src="resources/images/{1}.png" mime-type="image/png"/>
     </map:match>
  
  <!-- delegate to parent
     <map:handle-errors>
      <map:serialize status-code="500"/>
     </map:handle-errors>
  -->
    </map:pipeline>
   </map:pipelines>
  
  </map:sitemap>
  
  <!-- end of file -->
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/samples.xml
  
  Index: samples.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  
  <samples xmlns:xlink="http://www.w3.org/1999/xlink">
  
    <group name="Cocoon">
     <sample name="Back" href="../..">
      to Cocoon examples main page
     </sample>
    </group>
    
    <group name="Line Chart samples">
     <sample name="Line Chart 1" href="line/line1.jpg">
      Line chart.
     </sample>
     <sample name="Line Chart 2" href="line/line2.jpg">
      Line chart.
     </sample>
     <sample name="Line Chart 3" href="line/line3.jpg">
      Line chart.
     </sample>   
     <sample name="Line Chart 4" href="line/line4.jpg">
      Line chart.
     </sample>
     <sample name="Line Chart 5" href="line/line5.jpg">
      Line chart.
     </sample>
     <sample name="Line Chart 6" href="line/line6.jpg">
      Line chart.
     </sample>     
    </group>
  
    <group name="Multi Chart samples">
     <sample name="Multi Chart 1" href="multi/multi1.jpg">
      Line chart.
     </sample>
    </group>    
      
    <group name="Bar Chart samples">
     <sample name="Bar Chart 1" href="bar/bar1.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 2" href="bar/bar2.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 3" href="bar/bar3.jpg">
      Bar chart.
     </sample>   
     <sample name="Bar Chart 4" href="bar/bar4.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 5" href="bar/bar5.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 6" href="bar/bar6.jpg">
      Bar chart.
     </sample>     
     <sample name="Bar Chart 7" href="bar/bar7.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 8" href="bar/bar8.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 9" href="bar/bar9.jpg">
      Bar chart.
     </sample>  
     <sample name="Bar Chart 10" href="bar/bar10.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 11" href="bar/bar11.jpg">
      Bar chart.
     </sample>
     <sample name="Bar Chart 12" href="bar/bar12.jpg">
      Bar chart.
     </sample>     
    </group>
    
    <group name="Pie Chart samples">
     <sample name="Pie Chart 1" href="pie/pie1.jpg">
      Pie chart.
     </sample>
     <sample name="Pie Chart 2" href="pie/pie2.jpg">
      Pie chart.
     </sample>
     <sample name="Pie Chart 3" href="pie/pie3.jpg">
      Pie chart.
     </sample>   
     <sample name="Pie Chart 4" href="pie/pie4.jpg">
      Pie chart.
     </sample>
     <sample name="Pie Chart 5" href="pie/pie5.jpg">
      Pie chart.
     </sample>
     <sample name="Pie Chart 6" href="pie/pie6.jpg">
      Pie chart.
     </sample>     
     <sample name="Pie Chart 7" href="pie/pie7.jpg">
      Pie chart.
     </sample>
    </group>
    
  </samples>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar3Dchart.xml
  
  Index: bar3Dchart.xml
  ===================================================================
  <?xml version="1.0"?>
  <chart:chartdef xmlns:chart="http://apache.org/cocoon/Chart2Svg">
  <chart:appearance>
        <chart:type>bar</chart:type>
        <chart:title>Cocoon 1 vs Cocoon 2 :)</chart:title>
   <chart:LF3d/>  
        <chart:colors>
           <chart:color>#ffffff</chart:color>
           <chart:color>#666666</chart:color>
        </chart:colors>
        <chart:width>400</chart:width>
        <chart:height>280</chart:height>
     </chart:appearance>
    <chart:properties>
     <chart:min>0</chart:min>
      <chart:max>7</chart:max>
     </chart:properties>
     <chart:data>
        <result>
           <row>
              <cocoon1>1</cocoon1>
              <cocoon2>3</cocoon2>
              <cocoon3>5</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>3</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>5</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>3</cocoon3>
           </row>
        </result>
    </chart:data>
  </chart:chartdef>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/barchart.xml
  
  Index: barchart.xml
  ===================================================================
  <?xml version="1.0"?>
  <chart:chartdef xmlns:chart="http://apache.org/cocoon/Chart2Svg">
  <chart:appearance>
        <chart:type>bar</chart:type>
        <chart:title>Cocoon 1 vs Cocoon 2 :)</chart:title>
  
        <chart:colors>
           <chart:color>#ffffff</chart:color>
           <chart:color>#666666</chart:color>
        </chart:colors>
        <chart:width>400</chart:width>
        <chart:height>280</chart:height>
     </chart:appearance>
    <chart:properties>
     <chart:min>0</chart:min>
      <chart:max>7</chart:max>
     </chart:properties>
     <chart:data>
        <result>
           <row>
              <cocoon1>1</cocoon1>
              <cocoon2>3</cocoon2>
              <cocoon3>5</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>3</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>5</cocoon3>
           </row>
           <row>
              <cocoon1>2</cocoon1>
              <cocoon2>6</cocoon2>
              <cocoon3>3</cocoon3>
           </row>
        </result>
    </chart:data>
  </chart:chartdef>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/linechart.xml
  
  Index: linechart.xml
  ===================================================================
  <?xml version="1.0"?>
  <chart:chartdef xmlns:chart="http://apache.org/cocoon/Chart2Svg">
  <chart:appearance>
        <chart:type>line</chart:type>
        <chart:title>Cocoon 1 vs Cocoon 2 :)</chart:title>
        <chart:colors>
           <chart:color>#ffffff</chart:color>
           <chart:color>#666666</chart:color>
        </chart:colors>
        <chart:width>400</chart:width>
        <chart:height>280</chart:height>
     </chart:appearance>
    <chart:properties>
     <chart:min>0</chart:min>
      <chart:max>7</chart:max>
     </chart:properties>
     <chart:data>
        <chart:result>
           <chart:row>
              <chart:cocoon1>1</chart:cocoon1>
              <chart:cocoon2>3</chart:cocoon2>
              <chart:cocoon3>5</chart:cocoon3>
           </chart:row>
           <chart:row>
              <chart:cocoon1>2</chart:cocoon1>
              <chart:cocoon2>6</chart:cocoon2>
              <chart:cocoon3>3</chart:cocoon3>
           </chart:row>
           <chart:row>
              <chart:cocoon1>2</chart:cocoon1>
              <chart:cocoon2>6</chart:cocoon2>
              <chart:cocoon3>5</chart:cocoon3>
           </chart:row>
           <chart:row>
              <chart:cocoon1>2</chart:cocoon1>
              <chart:cocoon2>6</chart:cocoon2>
              <chart:cocoon3>3</chart:cocoon3>
           </chart:row>
        </chart:result>
    </chart:data>
  </chart:chartdef>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/testapplet.xml
  
  Index: testapplet.xml
  ===================================================================
  <?xml version="1.0"?>
  <xapplet:applet2svg xmlns:xapplet="http://apache.org/cocoon/Applet2Svg">
   <applet width="400" height="400" code="org.apache.cocoon.transformation.chart.TestAppklet.class"/>
  </xapplet:applet2svg>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar1.xml
  
  Index: bar1.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n>1991</n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n>1992</n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  <set id="2" name="South">
  <v><a>87</a></v>
  <v><a>88.6</a></v>
  <v><a>89.7</a></v>
  <v><a>90.6</a></v>
  <v><a>92.6</a></v>
  <v><a>92.6</a></v>
  <v><a>94.6</a></v>
  <v><a>96.6</a></v>
  <v><a>98.6</a></v>
  <v><a>98.6</a></v>
  <v><a>99.6</a></v>
  <v><a>99.6</a></v>
  <v><a>101</a></v>
  <v><a>103</a></v>
  <v><a>106</a></v>
  <v><a>106</a></v>
  <v><a>109</a></v>
  </set>
  <set id="3" name="West">
  <v><a>90</a></v>
  <v><a>89.6</a></v>
  <v><a>90.7</a></v>
  <v><a>91.6</a></v>
  <v><a>93.6</a></v>
  <v><a>94.6</a></v>
  <v><a>95.6</a></v>
  <v><a>97.6</a></v>
  <v><a>108.6</a></v>
  <v><a>108.6</a></v>
  <v><a>109.6</a></v>
  <v><a>109.6</a></v>
  <v><a>111</a></v>
  <v><a>113</a></v>
  <v><a>116</a></v>
  <v><a>116</a></v>
  <v><a>119</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="barChart" combine="difference" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar10.xml
  
  Index: bar10.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>2000</a></v>
  <v><n>Set B</n><a>1000</a></v>
  <v><n>Set C</n><a>3000</a></v>
  <v><n>Set D</n><a>-500</a></v>
  <v><n>Set E</n><a>8000</a></v>
  <v><n>Set F</n><a>5000</a></v>
  <v><n>Set G</n><a>10000</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar11.xml
  
  Index: bar11.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>2000</a></v>
  <v><n>Set B</n><a>1000</a></v>
  <v><n>Set C</n><a>3000</a></v>
  <v><n>Set D</n><a>-500</a></v>
  <v><n>Set E</n><a>8000</a></v>
  <v><n>Set F</n><a>5000</a></v>
  <v><n>Set G</n><a>10000</a></v>
  </set>
  <set id="2" name="Others">
  <v><n>Set A</n><a>-2000</a></v>
  <v><n>Set B</n><a>-1000</a></v>
  <v><n>Set C</n><a>-3000</a></v>
  <v><n>Set D</n><a>500</a></v>
  <v><n>Set E</n><a>-8000</a></v>
  <v><n>Set F</n><a>-5000</a></v>
  <v><n>Set G</n><a>-15000</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar12.xml
  
  Index: bar12.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>2</a></v>
  <v><n>Set B</n><a>1</a></v>
  <v><n>Set C</n><a>3</a></v>
  <v><n>Set D</n><a>-5</a></v>
  <v><n>Set E</n><a>8</a></v>
  <v><n>Set F</n><a>5</a></v>
  <v><n>Set G</n><a>10</a></v>
  </set>
  <set id="2" name="Others">
  <v><n>Set A</n><a>-2</a></v>
  <v><n>Set B</n><a>-10</a></v>
  <v><n>Set C</n><a>-3</a></v>
  <v><n>Set D</n><a>5</a></v>
  <v><n>Set E</n><a>-8</a></v>
  <v><n>Set F</n><a>-5</a></v>
  <v><n>Set G</n><a>-15</a></v>
  </set>
  <set id="3" name="More">
  <v><n>Set A</n><a>12</a></v>
  <v><n>Set B</n><a>-10</a></v>
  <v><n>Set C</n><a>3</a></v>
  <v><n>Set D</n><a>1</a></v>
  <v><n>Set E</n><a>13</a></v>
  <v><n>Set F</n><a>9</a></v>
  <v><n>Set G</n><a>5</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar2.xml
  
  Index: bar2.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n>1991</n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n>1992</n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  <set id="2" name="South">
  <v><a>87</a></v>
  <v><a>88.6</a></v>
  <v><a>89.7</a></v>
  <v><a>90.6</a></v>
  <v><a>92.6</a></v>
  <v><a>92.6</a></v>
  <v><a>94.6</a></v>
  <v><a>96.6</a></v>
  <v><a>98.6</a></v>
  <v><a>98.6</a></v>
  <v><a>99.6</a></v>
  <v><a>99.6</a></v>
  <v><a>101</a></v>
  <v><a>103</a></v>
  <v><a>106</a></v>
  <v><a>106</a></v>
  <v><a>109</a></v>
  </set>
  <set id="3" name="East">
  <v><a>90</a></v>
  <v><a>94.6</a></v>
  <v><a>95.7</a></v>
  <v><a>96.6</a></v>
  <v><a>97.6</a></v>
  <v><a>99.6</a></v>
  <v><a>100.6</a></v>
  <v><a>102.6</a></v>
  <v><a>113.6</a></v>
  <v><a>113.6</a></v>
  <v><a>113.6</a></v>
  <v><a>114.6</a></v>
  <v><a>116</a></v>
  <v><a>117</a></v>
  <v><a>121</a></v>
  <v><a>121</a></v>
  <v><a>127</a></v>
  </set>
  <set id="4" name="West">
  <v><a>95</a></v>
  <v><a>99.6</a></v>
  <v><a>110.7</a></v>
  <v><a>111.6</a></v>
  <v><a>113.6</a></v>
  <v><a>114.6</a></v>
  <v><a>115.6</a></v>
  <v><a>117.6</a></v>
  <v><a>128.6</a></v>
  <v><a>128.6</a></v>
  <v><a>129.6</a></v>
  <v><a>129.6</a></v>
  <v><a>131</a></v>
  <v><a>133</a></v>
  <v><a>136</a></v>
  <v><a>146</a></v>
  <v><a>159</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="barChart" combine="difference" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  <dataset ref-id="4"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar3.xml
  
  Index: bar3.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n>1991</n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n>1992</n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  <set id="2" name="South">
  <v><a>87</a></v>
  <v><a>88.6</a></v>
  <v><a>89.7</a></v>
  <v><a>90.6</a></v>
  <v><a>92.6</a></v>
  <v><a>92.6</a></v>
  <v><a>94.6</a></v>
  <v><a>96.6</a></v>
  <v><a>98.6</a></v>
  <v><a>98.6</a></v>
  <v><a>99.6</a></v>
  <v><a>99.6</a></v>
  <v><a>101</a></v>
  <v><a>103</a></v>
  <v><a>106</a></v>
  <v><a>106</a></v>
  <v><a>109</a></v>
  </set>
  <set id="3" name="East">
  <v><a>90</a></v>
  <v><a>94.6</a></v>
  <v><a>95.7</a></v>
  <v><a>96.6</a></v>
  <v><a>97.6</a></v>
  <v><a>99.6</a></v>
  <v><a>100.6</a></v>
  <v><a>102.6</a></v>
  <v><a>113.6</a></v>
  <v><a>113.6</a></v>
  <v><a>113.6</a></v>
  <v><a>114.6</a></v>
  <v><a>116</a></v>
  <v><a>117</a></v>
  <v><a>121</a></v>
  <v><a>121</a></v>
  <v><a>127</a></v>
  </set>
  <set id="4" name="West">
  <v><a>95</a></v>
  <v><a>99.6</a></v>
  <v><a>110.7</a></v>
  <v><a>111.6</a></v>
  <v><a>113.6</a></v>
  <v><a>114.6</a></v>
  <v><a>115.6</a></v>
  <v><a>117.6</a></v>
  <v><a>128.6</a></v>
  <v><a>128.6</a></v>
  <v><a>129.6</a></v>
  <v><a>129.6</a></v>
  <v><a>131</a></v>
  <v><a>133</a></v>
  <v><a>136</a></v>
  <v><a>146</a></v>
  <v><a>159</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="barChart" combine="merge" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  <dataset ref-id="4"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar4.xml
  
  Index: bar4.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>Set A</n><a>80</a></v>
  <v><n>Set B</n><a>77.6</a></v>
  <v><n>Set C</n><a>75.7</a></v>
  <v><n>Set D</n><a>76.6</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="550" height="300" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar5.xml
  
  Index: bar5.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set type="percent" id="1" name="North">
  <v><n>Set A</n><a>80%</a></v>
  <v><n>Set B</n><a>77.6%</a></v>
  <v><n>Set C</n><a>%</a></v>
  <v><n>Set D</n><a>7%</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="550" height="300" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar6.xml
  
  Index: bar6.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>Set A</n><a>80</a></v>
  <v><n>Set B</n><a></a></v>
  <v><n>Set C</n><a>150</a></v>
  <v><n>Set D</n><a>207</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="550" height="300" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar7.xml
  
  Index: bar7.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>0.02</a></v>
  <v><n>Set B</n><a>0.01</a></v>
  <v><n>Set C</n><a>0.6</a></v>
  <v><n>Set D</n><a>0.43</a></v>
  <v><n>Set E</n><a>0.95</a></v>
  <v><n>Set F</n><a>0.32</a></v>
  <v><n>Set G</n><a>0.45</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar8.xml
  
  Index: bar8.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>20</a></v>
  <v><n>Set B</n><a>-10</a></v>
  <v><n>Set C</n><a>30</a></v>
  <v><n>Set D</n><a>-5</a></v>
  <v><n>Set E</n><a>80</a></v>
  <v><n>Set F</n><a>50</a></v>
  <v><n>Set G</n><a>-10</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/bar/bar9.xml
  
  Index: bar9.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="Sets">
  <v><n>Set A</n><a>0.00120</a></v>
  <v><n>Set B</n><a>0.003</a></v>
  <v><n>Set C</n><a>0.002</a></v>
  <v><n>Set D</n><a>0.0005</a></v>
  <v><n>Set E</n><a>0.007</a></v>
  <v><n>Set F</n><a>0.002</a></v>
  <v><n>Set G</n><a>0.006</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="750" height="400" effect="3D">
  <graph type="barChart" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line1.xml
  
  Index: line1.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n>1991</n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n>1992</n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  <set id="2" name="South">
  <v><a>87</a></v>
  <v><a>88.6</a></v>
  <v><a>89.7</a></v>
  <v><a>90.6</a></v>
  <v><a>92.6</a></v>
  <v><a>92.6</a></v>
  <v><a>94.6</a></v>
  <v><a>96.6</a></v>
  <v><a>98.6</a></v>
  <v><a>98.6</a></v>
  <v><a>99.6</a></v>
  <v><a>99.6</a></v>
  <v><a>101</a></v>
  <v><a>103</a></v>
  <v><a>106</a></v>
  <v><a>106</a></v>
  <v><a>109</a></v>
  </set>
  <set id="3" name="West">
  <v><a>90</a></v>
  <v><a>89.6</a></v>
  <v><a>90.7</a></v>
  <v><a>91.6</a></v>
  <v><a>93.6</a></v>
  <v><a>94.6</a></v>
  <v><a>95.6</a></v>
  <v><a>97.6</a></v>
  <v><a>108.6</a></v>
  <v><a>108.6</a></v>
  <v><a>109.6</a></v>
  <v><a>109.6</a></v>
  <v><a>111</a></v>
  <v><a>113</a></v>
  <v><a>116</a></v>
  <v><a>116</a></v>
  <v><a>119</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" combine="compare" style="border:false;config:/default/lineChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line2.xml
  
  Index: line2.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>8</a></v>
  <v><n></n><a>10</a></v>
  <v><n></n><a>12</a></v>
  <v><n></n><a>13</a></v>
  <v><n></n><a>15</a></v>
  <v><n>1991</n><a>20</a></v>
  <v><n></n><a>21</a></v>
  <v><n></n><a>23</a></v>
  <v><n></n><a>25</a></v>
  <v><n></n><a>40</a></v>
  <v><n></n><a>45</a></v>
  <v><n>1992</n><a>30</a></v>
  <v><n></n><a>35</a></v>
  <v><n></n><a>41</a></v>
  <v><n></n><a>42</a></v>
  <v><n></n><a>47</a></v>
  <v><n>1993</n><a>55</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" combine="compare" style="border:false;config:/default/greenLineChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line3.xml
  
  Index: line3.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>130</a></v>
  <v><n></n><a>150</a></v>
  <v><n></n><a>180</a></v>
  <v><n></n><a>190</a></v>
  <v><n>1991</n><a>160</a></v>
  <v><n></n><a>150</a></v>
  <v><n></n><a>145</a></v>
  <v><n></n><a>140</a></v>
  <v><n></n><a>146</a></v>
  <v><n></n><a>150</a></v>
  <v><n>1992</n><a>170</a></v>
  <v><n></n><a>210</a></v>
  <v><n></n><a>220</a></v>
  <v><n></n><a>250</a></v>
  <v><n></n><a>300</a></v>
  <v><n>1993</n><a>350</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" combine="compare" style="border:false;config:/default/lineChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line4.xml
  
  Index: line4.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n>1991</n><a>70</a></v>
  <v><n>1992</n><a>170</a></v>
  <v><n>1993</n><a>80</a></v>
  <v><n>1993</n><a>95</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" combine="compare" style="border:false;config:/default/blueLineChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line5.xml
  
  Index: line5.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>30</a></v>
  <v><n></n><a>10</a></v>
  <v><n>1991</n><a>-20</a></v>
  <v><n></n><a>-60</a></v>
  <v><n></n><a>-80</a></v>
  <v><n>1992</n><a>-50</a></v>
  <v><n></n><a>-40</a></v>
  <v><n></n><a>-10</a></v>
  <v><n>1993</n><a>20</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" style="border:false;config:/default/lineChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/line/line6.xml
  
  Index: line6.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>-80</a></v>
  <v><n></n><a>-30</a></v>
  <v><n></n><a>-10</a></v>
  <v><n>1991</n><a>-20</a></v>
  <v><n></n><a>-60</a></v>
  <v><n></n><a>-80</a></v>
  <v><n>1992</n><a>-50</a></v>
  <v><n></n><a>-40</a></v>
  <v><n></n><a>-10</a></v>
  <v><n>1993</n><a>-20</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="lineChart" style="border:false;config:/default/lineChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/multi/multi1.xml
  
  Index: multi1.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n>1991</n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>75.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n></n><a>74.6</a></v>
  <v><n>1992</n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  <set id="2" name="South">
  <v><a>87</a></v>
  <v><a>88.6</a></v>
  <v><a>89.7</a></v>
  <v><a>90.6</a></v>
  <v><a>92.6</a></v>
  <v><a>92.6</a></v>
  <v><a>94.6</a></v>
  <v><a>96.6</a></v>
  <v><a>98.6</a></v>
  <v><a>98.6</a></v>
  <v><a>99.6</a></v>
  <v><a>99.6</a></v>
  <v><a>101</a></v>
  <v><a>103</a></v>
  <v><a>106</a></v>
  <v><a>106</a></v>
  <v><a>109</a></v>
  </set>
  <set id="3" name="West">
  <v><a>90</a></v>
  <v><a>89.6</a></v>
  <v><a>90.7</a></v>
  <v><a>91.6</a></v>
  <v><a>93.6</a></v>
  <v><a>94.6</a></v>
  <v><a>95.6</a></v>
  <v><a>97.6</a></v>
  <v><a>108.6</a></v>
  <v><a>108.6</a></v>
  <v><a>109.6</a></v>
  <v><a>109.6</a></v>
  <v><a>111</a></v>
  <v><a>113</a></v>
  <v><a>116</a></v>
  <v><a>116</a></v>
  <v><a>119</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="barChart" combine="difference" style="border:false;config:/default/barChart.xml">
  <dataset ref-id="1"/>
  <dataset ref-id="2"/>
  <dataset ref-id="3"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie1.xml
  
  Index: pie1.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>80</a></v>
  <v><n></n><a>77.6</a></v>
  <v><n></n><a>75.7</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>76.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>73.6</a></v>
  <v><n></n><a>72.6</a></v>
  <v><n>1993</n><a>72.6</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="pieChart" style="legendSpace:2;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie2.xml
  
  Index: pie2.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" style="config:/default/pieChart.xml" lang="de">
  <title>embeddedPieChart</title>
  <data>
  <set type="percent" id="1">
  <v>
  <a>100,0%</a>
  </v>
  <v>
  <a>0,0%</a>
  </v>
  </set>
  </data>
  <ggroup>
  <gset height="150" width="350">
  <graph style="legendSpace:4.3" effect="3D" type="embeddedPieChart">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie3.xml
  
  Index: pie3.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>AAAAAAA</n><a>3</a></v>
  <v><n>BBBBBBB</n><a>47.6</a></v>
  <v><n>CCCC</n><a>55.7</a></v>
  <v><n>DDDDD</n><a>26.6</a></v>
  <v><n>EEEEE</n><a>70</a></v>
  <v><n>FFFF</n><a>3</a></v>
  <v><n>G</n><a>6</a></v>
  <v><n>HHHHHHH</n><a>7.6</a></v>
  <v><n>IIIII</n><a>2.6</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="pieChart" style="legendSpace:2;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie4.xml
  
  Index: pie4.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>10</a></v>
  <v><n></n><a>7.6</a></v>
  <v><n></n><a>5</a></v>
  <v><n></n><a>6</a></v>
  <v><n></n><a>26</a></v>
  <v><n></n><a>73</a></v>
  <v><n></n><a>73</a></v>
  <v><n></n><a>72</a></v>
  <v><n>1993</n><a>72</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="pieChart" style="legendSpace:2;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie5.xml
  
  Index: pie5.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1990</n><a>8</a></v>
  <v><n>1991</n><a>77.6</a></v>
  <v><n>1992</n><a>5.7</a></v>
  <v><n>1993</n><a>6.6</a></v>
  <v><n>1994</n><a>76.6</a></v>
  <v><n>1995</n><a>3.6</a></v>
  <v><n>1996</n><a>3.6</a></v>
  <v><n>1997</n><a>72.6</a></v>
  <v><n>1998</n><a>2.6</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350pt" height="200pt" effect="3D">
  <graph type="pieChart" style="legendSpace:0.15in;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie6.xml
  
  Index: pie6.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1</n><a>80</a></v>
  <v><n>2</n><a>77.6</a></v>
  <v><n>3</n><a>5.072</a></v>
  <v><n>4</n><a>6.564</a></v>
  <v><n>5</n><a>3.324</a></v>
  <v><n>6</n><a>2.275</a></v>
  <v><n>7</n><a>3.6</a></v>
  <v><n>8</n><a>72.6</a></v>
  <v><n>9</n><a>72.6</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="pieChart" style="legendSpace:2;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/content/static/pie/pie7.xml
  
  Index: pie7.xml
  ===================================================================
  <xcml xmlns="http://xml.apache.org/2001/xcml" country="EN" lang="en" style="border:false;">
  <title>test</title>
  <data>
  <set id="1" name="North">
  <v><n>1</n><a>4.01</a></v>
  <v><n>2</n><a>6.04</a></v>
  <v><n>3</n><a>5.16</a></v>
  <v><n>4</n><a>76.6</a></v>
  <v><n>5</n><a>76.6</a></v>
  <v><n>6</n><a>73.6</a></v>
  <v><n>7</n><a>73.6</a></v>
  <v><n>8</n><a>2.55</a></v>
  </set>
  </data>
  <ggroup>
  <gset width="350" height="200" effect="3D">
  <graph type="pieChart" style="legendSpace:2;border:false;config:/default/pieChart.xml">
  <dataset ref-id="1"/>
  </graph>
  </gset>
  </ggroup>
  </xcml>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/charts/stylesheets/simple-samples2html.xsl
  
  Index: simple-samples2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Samples</title>
     </head>
     <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
      <p align="center"><font size="+0" face="arial,helvetica,sanserif" color="#000000">Samples</font></p>
  
      <xsl:apply-templates/>
  
      <p align="center">
       <font size="-1">
        Copyright &#169; 1999-2001 <a href="http://www.apache.org">poi project founders</a>.<br/>
        All rights reserved.
       </font>
      </p>
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="samples">
    <xsl:variable name="all-samples" select="count(group/sample)"/>
    <xsl:variable name="half-samples" select="round($all-samples div 2)"/>
      
    <table width="100%">
     <tr>
      <td width="50%" valign="top">
       <xsl:for-each select="group">  
        <xsl:variable name="group-position" select="position()"/>
        <xsl:variable name="current-sample" select="1 + count(../group[position() &lt;= $group-position]/sample)"/>
        <xsl:choose>
         <xsl:when test="$current-sample &lt;= $half-samples">
         <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="@name"/></font>
            </td>
           </tr>
           <tr>
            <td width="100%" bgcolor="#ffffff" align="left">
             <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
              <xsl:apply-templates/>
             </table>
            </td>
           </tr>
          </table>
          
            </td>
           </tr>        
           </tbody>
          </table>
          
          <br/>
         </xsl:when>
         <xsl:otherwise></xsl:otherwise>
        </xsl:choose>
       </xsl:for-each>
      </td>
      <td valign="top">
       <xsl:for-each select="group">  <!-- [position()<=$half] -->
        <xsl:variable name="group-position" select="position()"/>
        <xsl:variable name="current-sample" select="1 + count(../group[position() &lt;= $group-position]/sample)"/>
        <xsl:choose>
         <xsl:when test="not($current-sample &lt;= $half-samples)">
         <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="@name"/></font>
            </td>
           </tr>
           <tr>
            <td width="100%" bgcolor="#ffffff" align="left">
             <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
              <xsl:apply-templates/>
             </table>
            </td>
           </tr>
          </table>
           </td>
           </tr>        
           </tbody>
          </table>
          <br/>
         </xsl:when>
         <xsl:otherwise></xsl:otherwise>
        </xsl:choose>
       </xsl:for-each>
      </td>
     </tr>
    </table>
   </xsl:template>
   
   <xsl:template match="sample">
    <tr>
     <td width="100%" bgcolor="#ffffff" align="left">
      <font size="+0" face="arial,helvetica,sanserif" color="#000000">    
        <a href="{@href}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
        <xsl:value-of select="."/>
      </font>
     </td>
    </tr>
   </xsl:template>
   
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/README
  
  Index: README
  ===================================================================
  SourceWritingTransformer - Installation Notes.
  
  
  Once you have the latest copy of Cocoon 2.1 HEAD Branch from CVS, compile it.
  
  You could use the following command:
  
  ./build.sh  -Dinclude.webapp.libs=yes -Dinclude.scratchpad.libs=yes webapp
  
  This ensures the scratchpad libraries are included in the build.
  
  Next, move cocoon.war to your webapps directory, and start TomCat.
  	
  In your browser go to:
  
  	<http://localhost:8080/cocoon/mount/editor/>
  	
  	
  	
  Please report any problems.
  
  There is a sample editor, called <slash-edit/>. It allows you to edit XML files in the outer 'editor/docs/' directory. Currently there are two samples, one (Alpha) can edit the entire file in one form field, the other (Bravo) breaks down the xml into seperate form fields, converting <para/> and <br/> tags to double and single linebreaks in the form, and back agian on submit.
  
  Alpha uses the StreamGenerator to Parse the Request data so it can only handle a single field. The main problem with it is that if there is an error in your XML, your will only get part of it written to disk.
  
  Bravo, does not suffer from this problem because the form fields are not Parsed, the problem now is that you cannot write any XML tags, without them turning into Entities. Maybe this is useful for some purposes.
  
  I think we will need a RequestParsingGenerator, that can selectively parse fields, and signal via the generated XML that there has been a Parsing error, not by throwing SaxExceptions, that way mal-formed XML in form fields can be handled more gracefully.
  
  
  To use this in your project, you need to add the inner 'editor' folder and 'editor.xmap' to your project, and add the 'editor pipelines' from the file 'sitemap.xmap' to your sitemap.
  
  Then you need to develop components for your particular document markup!
  	ie. StyleSheets that understand your documents, editor config for your forms etc.
  
  Here is a breakdown of the StyleSheets used by the editor, and what they do:
  
  Generation Stage
  	generation-components.xsl
  		contains generic generation components for things like:
  		CR to para tag conversion, calculating browser path etc.
  	dir2editor.xsl
  		converts a directory listing from the XPathDirectoryGenerator into an Editor
  	file2editor.xsl
  		copies the output of the FileGenerator
  	request2editor.xsl
  		constructs a new document from the output of the RequestGenerator 
  	stream2editor.xsl
  		constructs a new document from the output of the  StreamGenerator
  
  Validation Stage
  	validationFilter.xsl
  		modifies the behaviour of the request to 'get', if a validation error has occurred, so that the user can re-edit the content
  	editor2writer.xsl
  		wraps the instance data in tags to get SourceWritingTransformer to do it's job, when the behaviour is 'put'
  	schematron-validator2xsl.xsl
  		main validation.xsl generator, set up specifically for slash-edit
  	schematron-wrappers.xsl
  		wrappers to handle slash-edit data
  	schematron-extensions.xsl
  		extension to calculate paths to fields (needs rewriting)
  
  Rendering Stage
  
  	editor-alpha-components.xsl
  		Handles Alpha form creation
  	editor-bravo-components.xsl
  		Handles Bravo Form creation
  	editor-components.xsl
  		contains generic editor components for things like:
  		directory listing formatting, source:write reporting, editor-view etc.
  	editor-page2html.xsl
  		controls the style of the page for all 'behaviours' calling different templates as appropriate.
  		It xsl:include's 'editor-components.xsl', 'editor-utils.xsl', 
  		'editor-alpha-components.xsl' and 'editor-bravo-components.xsl'.
  		It reacts to the behaviour name embedded in the structure of the xml, by the generation process			
  	editor-utils.xsl
  		a few generic utilities used by editor-page2html.xsl
  	simple-page2html.xsl
  		renders <slash-edit/> welcome page
  
  
  The file 'mount/editor/editor/docs/[sub-editor]-config.xml' contains information used by 'editor-page2html.xsl' such as the names of buttons, the tools for each behaviour, the available commands etc. for each sub-editor.
  
  
  
  Thanks
  
  Jeremy Quinn <jeremy@apache.org>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/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:serializers default="html"/>
      <map:transformers default="xslt"/>
      <map:readers default="resource"/>
      <map:matchers default="wildcard"/>
      <map:selectors default="browser"/>
    </map:components>
  
    <map:pipelines>
  
      <map:pipeline>
  
      	<!-- the default page -->
  			<map:match pattern="">
  				<map:redirect-to uri="welcome"/>
  			</map:match>
  
  <!-- start EDITING PIPELINES -->
  <!-- We mount the Editor SiteMap into the same base as this SiteMap, so the Editor can reach this SiteMap's files -->
  
  			<!-- slash-edit pipeline -->
  			<!-- edit/, edit/new/*, edit/get/*, edit/put, edit/view/* -->
  			<map:match pattern="edit**">
  				<map:mount uri-prefix="edit" src="editor.xmap" check-reload="yes"/>
  			</map:match>
  
  			<!-- test/result pipeline -->
  			<!-- /test/*, /result/*, result/*/* -->
  			<map:match pattern="*/**">
  				<map:mount uri-prefix="" src="test.xmap" check-reload="yes"/>
  			</map:match>
  
  <!-- end EDITING PIPELINES -->
  
      	<!-- view page -->
  			<map:match pattern="**">
  				<map:generate src="docs/{1}.xml"/>
  				<map:transform src="stylesheets/simple-page2html.xsl"/>
  				<map:serialize type="html"/>								
  			</map:match>
  
  			<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>
  
  <!-- end of file -->
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/test.xmap
  
  Index: test.xmap
  ===================================================================
  <?xml version="1.0"?>
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    <map:components>
      <map:generators default="file"/>
      <map:serializers default="html">
      
      	<!-- You can define your own Serializer for FileWritingTransformer to use-->
      
  			<map:serializer
  				name="my-xml-serializer"
  				mime-type="text/xml" logger="sitemap.serializer.myxml"
  				src="org.apache.cocoon.serialization.XMLSerializer"
  			>
  				<!--<doctype-system>urn:hrc:doc</doctype-system>-->
  				<encoding>utf-8</encoding>
  				<omit-xml-declaration>no</omit-xml-declaration>
  				<indent>2</indent>
  			</map:serializer>
  			
      </map:serializers>
      <map:transformers default="xslt">
      
      	<!-- Define 'filewriter' as the name for FileWritingTransformer -->
      	<!-- You can set up the default Serialiser here -->
      	<!-- You can also set it in the invocation tag below -->
      	<!-- or place serializer="serializer-name" in the source:write tag -->
      	<!-- if you leave it out altogether, 'xml' is used -->
      
      	<map:transformer name="filewriter" logger="sitemap.transformer.tofile"
  				src="org.apache.cocoon.transformation.SourceWritingTransformer">
  				<serializer>my-xml-serializer</serializer>
  			</map:transformer>
  			
      </map:transformers>
      <map:readers default="resource"/>
      <map:matchers default="wildcard"/>
      <map:selectors default="browser"/>
    </map:components>
  
    <map:pipelines>
  
      <map:pipeline>
      	
     <!-- the tests -->
  
  			<map:match pattern="test/9">
  			 <map:generate type="file" src="tests/test9/input.xml"/>
  			 <map:transform type="xslt" src="tests/test9/inc.xsl"/>
  			 <map:transform type="xslt" src="tests/test9/prepareWrite.xsl"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/9-before.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform> <!---->
  			 <map:transform type="filewriter"/>
  			<map:transform type="log">
  					<map:parameter name="logfile" value="tests/9-after.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  			 <map:transform src="stylesheets/simple-page2html.xsl">
  				 <map:parameter name="view-source" value="tests/test9/input.xml"/>
  			 </map:transform>
  			 <map:serialize type="html"/>
  			 <!--	<map:serialize type="xml"/> -->
  			</map:match>
  
  			<map:match pattern="test/6">
  			 <map:generate type="file" src="tests/test6/input.xml"/>
  			 <map:transform type="xslt" src="tests/test6/inc.xsl"/>
  			 <map:transform type="xslt" src="tests/test6/prepareWrite.xsl"/>
  			 <map:transform type="filewriter">
  				<map:parameter name="serializer" value="xml"/>
  			 </map:transform>
  			 <map:transform src="stylesheets/simple-page2html.xsl">
  				 <map:parameter name="view-source" value="tests/test6/input.xml"/>
  			 </map:transform>
  			 <map:serialize type="html"/>
  			</map:match>
  
  			<map:match pattern="test/5">
  				<map:generate src="tests/test5.xml"/>
  				<map:transform src="tests/make-page.xsl"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/5-before.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  				<map:transform type="filewriter">
  					<map:parameter name="serializer" value="xml"/> <!-- invoke the filewriter with 'xml' serializer -->
  				</map:transform> 
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/5-after.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  				<map:transform src="stylesheets/simple-page2html.xsl">
  					<map:parameter name="view-source" value="tests/test5.xml"/>
  				</map:transform>
  				<map:serialize type="html"/>								
  			</map:match>
  
  			<map:match pattern="test/4">
  				<map:generate src="tests/test4.xml"/>
  				<map:transform type="cinclude"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/4-before.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  				<map:transform type="filewriter"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/4-after.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  				<map:transform src="stylesheets/simple-page2html.xsl">
  					<map:parameter name="view-source" value="tests/test4.xml"/>
  				</map:transform>
  				<map:serialize type="html"/>								
  			</map:match>
  
  			<map:match pattern="test/*">
  				<map:generate src="tests/test{1}.xml"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/{1}-before.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform><!--	-->
  				<map:transform type="filewriter"/>
  				<map:transform type="log">
  					<map:parameter name="logfile" value="tests/{1}-after.log"/>
  					<map:parameter name="append" value="no"/>
  				</map:transform>
  				<map:transform src="stylesheets/simple-page2html.xsl">
  					<map:parameter name="view-source" value="tests/test{1}.xml"/>
  				</map:transform>
  				<map:serialize type="html"/>	
  			<!--	<map:serialize type="xml"/>			-->
  			</map:match>
  
   <!-- the results -->
  			<map:match pattern="result/*">
  				<map:generate src="tests/result{1}.xml"/>
  				<map:transform src="stylesheets/simple-page2html.xsl">
  					<map:parameter name="view-source" value="tests/result{1}.xml"/>
  				</map:transform>
  				<map:serialize type="html"/>								
  			</map:match>
  
      	<!-- the result of test3 -->
  			<map:match pattern="result/*/*">
  				<map:generate src="tests/{1}/result{2}.xml"/>
  				<map:transform src="stylesheets/simple-page2html.xsl">
  					<map:parameter name="view-source" value="tests/{1}/result{2}.xml"/>
  				</map:transform>
  				<map:serialize type="html"/>								
  			</map:match>
  		</map:pipeline>
  
    </map:pipelines>
  </map:sitemap>
  
  <!-- end of file -->
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/docs/source.xml
  
  Index: source.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
   <title>SourceWritingTransformer</title>
   <content>
  
    <para>
  	NB: SourceWritingTransformer has been updated with new tags.
    </para>
  
    <para>Please try the <a href="tests">tests</a></para>
    
    <para>
     Uses the tags: 
     
     <pre>&lt;source:write/&gt;
  &lt;source:insert/&gt;
  	&lt;source:path/&gt;
  	&lt;source:source/&gt;
  	&lt;source:replace/&gt;
  	&lt;source:reinsert/&gt;
  	&lt;source:fragment/&gt;</pre>
     in the namespace xmlns:source="http://apache.org/cocoon/source/1.0".
    </para>
      
    <para>
     The contents of the <code>&lt;source:fragment/&gt;</code> tag are written to the specified WriteableSource when the document containing it is transformed by SourceWritingTransformer.
    </para>
  
    <para>
     Thankfully, FileSource is no longer the only Source that currently implements WritableSource; there are implementations of WebDAV and Apache Slide WritableSources in the scratchpad.
     Hopefully further WriteableSource implementations (XMLDB, CVS, Email, SQL, etc.) will be appear in the future.
    </para>
      
  
   <para>Definition:</para>
   <pre>
   &lt;map:transformer name="tofile" src="org.apache.cocoon.transformation.SourceWritingTransformer"&gt;
     &lt;map:parameter name="serializer" value="xml"/&gt;  &lt;!-- this is the default Serializer (if your Source needs one, like for instance FileSource) --&gt;
   &lt;/map:transformer/&gt;
   </pre>
  
   <para>Invocation:</para>
   <pre>
   &lt;map:transform type="tofile"&gt;
     &lt;map:parameter name="serializer" value="xml"/&gt;   &lt;!-- you can optionally override the serializer here --&gt;
   &lt;/map:transform&gt;
   </pre>
  
   <para>The Tags:</para>
   <pre>
   &lt;source:write create="[true]|false"&gt; - replaces the entire content of an existing asset, if @create is 'true' (default), a new asset will be created if one does not already exist.
       &lt;source:source&gt;The System ID of the asset to be written to&lt;/source:source&gt; - eg: "docs/blah.xml" or "context://blah.xml" etc.
       &lt;source:path&gt;[Optional] XPath to specify how your content is wrapped&lt;/source:path&gt; - eg: "doc" (your content is placed inside a &lt;doc/&gt; root tag). NOTE: if this value is omitted, your content MUST have only ONE top-level node.
       &lt;source:fragment&gt;The XML Fragment to be written&lt;/source:fragment&gt; - eg: "&lt;foo&gt;&lt;bar id="dogcow"/&gt;&lt;/foo&gt;" or "&lt;foo/&gt;&lt;bar&gt;&lt;dogcow/&gt;&lt;bar/&gt;" etc. NOTE: the second example type, can only be used when the &lt;source:path/&gt; tag has been specified.
   &lt;source:write&gt;
   
   &lt;source:insert create="[true]|false" overwrite="[true]|false"&gt; - inserts content into an existing asset, if @create is 'true' (default), a new asset will be created if one does not already exist. If @overwrite is set to 'true' the data is only inserted if the node specified by the 'replacePath' does not exists.
       &lt;source:source&gt;The System ID of the asset to be written to&lt;/source:source&gt; - eg: "docs/blah.xml" or "context://blah.xml" etc.
       &lt;source:path&gt;XPath specifying the node into which the content is inserted&lt;/source:path&gt; - eg: "doc" (your content is appended as the last child of the &lt;doc/&gt; root tag), or "doc/section[3]". NOTE: this tag is required in &lt;source:insert/&gt; unlike &lt;source:write/&gt; where it is optional.
       &lt;source:replace&gt;[Optional] XPath (relative to &lt;source:path/&gt;) to the node that is replaced by your new content&lt;/source:replace&gt; - eg: "foo/bar/dogcow/@status='cut'" (is equivalent to this in XSLT: select="foo[bar/dogcow/@status='cut']").
       &lt;source:reinsert&gt;[Optional] The XPath (relative to &lt;source:replace/&gt;) to backup the overwritten node to&lt;/source:reinsert&gt; - eg: "foo/versions" or "/doc/versions/foo". NOTE: If specified and a node is replaced, all children of this replaced node will be reinserted at the given path.
       &lt;source:fragment&gt;The XML Fragment to be written&lt;/source:fragment&gt; - eg: "&lt;foo&gt;&lt;bar id="dogcow"/&gt;&lt;/foo&gt;" or "&lt;foo/&gt;&lt;bar&gt;&lt;dogcow/&gt;&lt;bar/&gt;" etc. 
   &lt;source:insert&gt;
   </pre>
  
  
   <para>Input XML document example (write):</para>
   <pre>
   &lt;page&gt;
     ...
     &lt;source:write xmlns:source="http://apache.org/cocoon/source/1.0"&gt;
       &lt;source:source&gt;context://doc/editable/my.xml&lt;/source:source&gt;      
       &lt;source:fragment&gt;&lt;page&gt;
         &lt;title&gt;Hello World&lt;/title&gt;
         &lt;content&gt;
           &lt;p&gt;This is my first paragraph.&lt;/p&gt;
         &lt;/content&gt;
       &lt;/page&gt;&lt;/source:fragment&gt;
     &lt;/source:write&gt;
     ...
   &lt;/page&gt;
   </pre>
  
   <para>Input XML document example (insert at end):</para>
   <pre>
   &lt;page&gt;
     ...
     &lt;source:insert xmlns:source="http://apache.org/cocoon/source/1.0"&gt;
       &lt;source:source&gt;context://doc/editable/my.xml&lt;/source:source&gt;      
       &lt;source:path&gt;page/content&lt;/source:path&gt;      
       &lt;source:fragment&gt;
         &lt;p&gt;This paragraph gets &lt;emp&gt;inserted&lt;/emp&gt;.&lt;/p&gt;
         &lt;p&gt;With this one, at the end of the content.&lt;/p&gt;
       &lt;/source:fragment&gt;
     &lt;/source:insert&gt;
     ...
   &lt;/page&gt;
   </pre>
  
   <para>Input XML document example (insert at beginning):</para>
   <pre>
   &lt;page&gt;
     ...
     &lt;source:insert&gt;
       &lt;source:source&gt;context://doc/editable/my.xml&lt;/source:source&gt;
       &lt;source:path&gt;page&lt;/source:path&gt;
       &lt;source:replace&gt;content&lt;/source:replace&gt;
       &lt;source:reinsert&gt;content&lt;/source:reinsert&gt;
       &lt;source:fragment&gt;
         &lt;content&gt;
           &lt;p&gt;This new paragraph gets inserted &lt;emp&gt;before&lt;/emp&gt; the other ones.&lt;/p&gt;
         &lt;/content&gt;
       &lt;/source:fragment&gt;
      &lt;source:insert&gt;
     ...
   &lt;/page&gt;
   </pre>
  
   <para>Input XML document example (replace):</para>
   <pre>
   &lt;page&gt;
     ...
     &lt;source:insert xmlns:source="http://apache.org/cocoon/source/1.0"&gt;
       &lt;source:source&gt;context://doc/editable/my.xml"&lt;/source:source&gt;      
       &lt;source:path&gt;page/content&lt;/source:path&gt;      
       &lt;source:replace&gt;p[1]&lt;/source:replace&gt;      
       &lt;source:fragment&gt;
         &lt;p&gt;This paragraph &lt;emp&gt;replaces&lt;/emp&gt; the first paragraph.&lt;/p&gt;
       &lt;/source:fragment&gt;
     &lt;/source:insert&gt;
     ...
   &lt;/page&gt;
   </pre>
  
   <para>Output XML document example:</para>
   <pre>
   &lt;page&gt;
     ...
     &lt;sourceResult&gt;
       &lt;action&gt;new|overwritten|none&lt;/action&gt;
       &lt;behaviour&gt;write|insert&lt;behaviour&gt;
       &lt;execution&gt;success|failure&lt;/execution&gt;
       &lt;serializer&gt;xml&lt;/serializer&gt;
       &lt;source&gt;file:/source/specific/path/to/context/doc/editable/my.xml&lt;/source&gt;
     &lt;/sourceResult&gt;
     ...
   &lt;/page&gt;
   </pre>
  
  
  <para> The XPath specification is very complicated. So here is an example for the sitemap:</para>
   <pre>
   &lt;page xmlns:source="http://apache.org/cocoon/source/1.0"&gt;
     ...
   &lt;source:insert&gt;
     &lt;source:source&gt;sitemap.xmap&lt;/source:source&gt;
     &lt;source:path&gt;/*[namespace-uri()="http://apache.org/cocoon/sitemap/1.0" and local-name()="sitemap"]/*[namespace-uri()="http://apache.org/cocoon/sitemap/1.0" and local-name()="components"]/*[namespace-uri()="http://apache.org/cocoon/sitemap/1.0" and local-name()="generators"]&lt;/source:path&gt;
     &lt;source:fragment&gt;
  	  	&lt;generator name="file" xmln="http://apache.org/cocoon/sitemap/1.0"&gt;
  			&lt;test/&gt;
  		&lt;/generator&gt;
     &lt;/source:fragment&gt;
     &lt;source:replace&gt;*[namespace-uri()="http://apache.org/cocoon/sitemap/1.0" and local-name()="generator" and attribute::name="file"]&lt;/source:replace&gt;
   &lt;/source:insert&gt;
     ...
   &lt;/page&gt;
   </pre>
  
   <para>This insert replaces (if it exists) the file generator definition with a new one.
   As the sitemap uses namespaces the XPath for the generator is rather complicated.
   Due to this it is necessary that the node specified by path exists if namespaces
   are used! Otherwise a node with the name * would be created...</para>
  
  <para>The create attribute of insert. If this is set
  to true (default is true), the file is created if it does not exists.
  If it is set to false, it is not created, making insert a real insert.
  create is only usable for files!</para>
  <para>In addition the overwrite attribute is used to check if replacing is allowed.
  If overwrite is true (the default) the node is replaced. If it is false
  the node is not inserted if the replace node is available.</para>
  
  <para>[JQ] - the way I understand this, looking at the code: 
  <pre>
   if 'replace' is not specified, your 'fragment' is appended as a child of 'path'.
   if 'replace' is specified and it exists and 'overwrite' is true, your 'fragment' is inserted in 'path', before 'replace' and then 'replace' is deleted.
   if 'replace' is specified and it exists and 'overwrite' is false, no action occurs.
   if 'replace' is specified and it does not exist and 'overwrite' is true, your 'fragment' is appended as a child of 'path'.
   if 'replace' is specified and it does not exist and 'overwrite' is false, your 'fragment' is appended as a child of 'path'.
   if 'reinsert' is specified and it does not exist, no action occurs.
  </pre></para>
  
  <para> The &lt;source:reinsert&gt; option can be used to
   reinsert a replaced node at a given path in the new fragment.</para>
      
      
    <para>
     Known Problems:
    </para>
  
    <para>Improper namespace handling. Namespace declarations are not copied to the Source, resulting in invalid XML.</para>
    <para>I cannot get the 'insert before' example working, which uses the &lt;source:reinsert/&gt; tag.</para>
  
    <para>
     Warning:
    </para>
  
    <para>It is not known how robust this transformer is under even moderate load, especially when it comes to more than one person modifying the same file at the same time.</para>
  
   </content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/docs/tests.xml
  
  Index: tests.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
   <title>SourceWritingTransformer Test Suite</title>
   <content>
    <para>
  	NB: SourceWritingTransformer has replaced FileWritingTransformer.
    </para>
    <para>
  	Tests: Please run these tests and report any problems.
    </para>
    <para>
  	Test 1: <a href="test/1">Test 1</a>: the basic source:write test, makes <a href="result/1">Result 1</a>.
    </para>
    <para>
  	Test 2: <a href="test/2">Test 2</a>: the source:write namespace test, makes <a href="result/2">Result 2</a>, with the XLink namespace used inside. <span class="failure">Known to fail</span> (the written file is unparseable, because the namespace declaration is missing).
    </para>
    <para>
    Test 3: <a href="test/3">Test 3</a>: the source:write new folder test, makes <a href="result/newfolder/3">Result 3</a>, in a new folder.
    </para>
    <para>
  	Test 4: <a href="test/4">Test 4</a>: the source:write XInclude test, makes <a href="result/4">Result 4</a>, having XIncluded the content earlier in the pipeline.
    </para>
    <para>
  	Test 5: <a href="test/5">Test 5</a>: the source:write XSLT test, a <a target="source" href="../../view-source?filename=samples/editor/tests/make-page.xsl">StyleSheet</a> makes <a href="result/5">Result 5</a>, from parts of <a href="test/5">Test 5</a>.
    </para>
    <para>
  	Test 6: <a href="test/6">Test 6</a>: the source:write read/write test, this is the great news, it was not expected to work, but it does!! This test first reads a file, modifies it then writes it back to the same place. Thanks to Olivier Rossel for contributing this.
    </para>
    <para>
  	Test 7: <a href="test/7">Test 7</a>: the source:insert after test, inserts a paragraph after the existing one in <a href="result/7">Result 7</a>.
    </para>
    <para>
  	Test 8: <a href="test/8">Test 8</a>: source:insert before test, this test attempts to insert a paragraph before existing ones using source:reinsert, <span class="failure">it currently fails</span>, either because I am using it wrong or the code does not work properly.
    </para>
    <para>
  	Test 9: <a href="test/9">Test 9</a>: source:insert replace test, similar to test 6, it updates the contents of a single tag, but this time it inserts, not overwrites.
    </para>
   </content>
  </page>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/docs/welcome.xml
  
  Index: welcome.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
   <title>Experimental File Editing Pipelines</title>
   <content>
    <para>Please try the <a href="tests">tests</a>
  </para>
    <para>Please try out the demo file editor <a href="edit/">&lt;slash-edit/&gt;</a>
  </para>
    <para>This suite uses the <a href="source">SourceWritingTransformer</a>
  </para>
    
   </content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/alpha-config.xml
  
  Index: alpha-config.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <config title="&lt;slash-edit/&gt; alpha">
  
  <!-- Use this file to modify the text the editor displays -->
  <!-- if you want to change the names of the 'behaviours' make the same changes in the editor.xmap! -->
  
  <!-- Various display strings -->
  	<title behaviour="new">Make a new Page</title>
  	<title behaviour="get">Edit a Page</title>
  	<title behaviour="put">Save Results</title>
  	<title behaviour="see">View a Page</title>
  	<title behaviour="dir">Directory Listing</title>
  	<title behaviour="pre">Page Preview</title>
  	<title behaviour="error">Error</title>
  	
  	<notify behaviour="new">Making a new File at</notify>
  	<notify behaviour="get">Editing the File at</notify>
  	<notify behaviour="put">Results of saving a file at</notify>
  	<notify behaviour="see">Viewing the File at</notify>
  	<notify behaviour="dir">Directory Listing of</notify>
  	<notify behaviour="pre">Editor Preview of</notify>
  	<notify behaviour="error">An Error has occurred</notify>
  
  	<notes behaviour="new">Please edit the XML, then click the 'Make New File' button above</notes>
  	<notes behaviour="get">Please edit the XML, then click the 'Save My Changes' button above</notes>
  	<notes behaviour="put">Thanks for using &lt;slash-edit/&gt;</notes>
  	<notes behaviour="see">This is the editor-view of your file, internal links are not likely to work correctly.</notes>
  	<notes behaviour="dir">Please choose a file to view in the editor</notes>
  	<notes behaviour="pre">Please confirm your changes, or fix your mistakes</notes>
  
  <!-- The commands -->
  	<command behaviour="new" tip="Make a new File" icon="new.gif">new(alpha)</command>
  	<command behaviour="get" tip="Edit this File" icon="get.gif">get(alpha)</command>
  	<command behaviour="put">put(alpha)</command>
  	<command behaviour="see" tip="See this File" icon="see.gif">see(alpha)</command>
  	<command behaviour="dir" tip="View Directory listing" icon="dir.gif">dir(alpha)</command>
  	<command behaviour="pre">pre(alpha)</command>
  
  <!-- text for form buttons -->	
  	<button behaviour="new" tip="This will create a new file at the location specified in the 'Save as' field">Make New File</button>
  	<button behaviour="get" tip="View the result of your changes, without overwriting the original">Preview My Changes</button>
  	<button behaviour="pre" tip="Your changes will written">Save</button>
  	<button behaviour="back" tip="You can re-edit the form">Cancel</button>
  
  <!-- the tools available to each behaviour -->
  	<tools behaviour="new">
  		<tool command="dir"/>
  		<tool command="new"/>
  	</tools>
  	<tools behaviour="get">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="put">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="get"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="see">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="get"/>
  	</tools>
  	<tools behaviour="dir">
  		<tool command="new"/>
  	</tools>
  	<tools behaviour="pre">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="error">
  		<tool command="dir"/>
  		<tool command="new"/>
  	</tools>
  
  <!-- what to call the parent directory link -->
  	<parent-dir tip="View Parent Directory listing">Parent ..</parent-dir>
  <!-- what to call new files -->
  	<default-new-file>new.xml</default-new-file>
  </config>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/bravo-config.xml
  
  Index: bravo-config.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <config title="&lt;slash-edit/&gt; bravo">
  
  <!-- Use this file to modify the text the editor displays -->
  <!-- if you want to change the names of the 'behaviours' make the same changes in the editor.xmap! -->
  
  <!-- Various display strings -->
  	<title behaviour="new">Make a new Document</title>
  	<title behaviour="get">Edit a Document</title>
  	<title behaviour="put">Save Results</title>
  	<title behaviour="see">View a Document</title>
  	<title behaviour="dir">Directory Listing</title>
  	<title behaviour="pre">Document Preview</title>
  	<title behaviour="error">Error</title>
  	
  	<notify behaviour="new">Making a new Document at</notify>
  	<notify behaviour="get">Editing the Document at</notify>
  	<notify behaviour="put">Results of saving a Document at</notify>
  	<notify behaviour="see">Viewing the Document at</notify>
  	<notify behaviour="dir">Directory Listing of</notify>
  	<notify behaviour="pre">Editor Preview of</notify>
  	<notify behaviour="error">An Error has occurred</notify>
  
  	<notes behaviour="new">Please edit the fields, then click the 'Make New Document' button above</notes>
  	<notes behaviour="get">Please edit the fields, then click the 'Save My Changes' button above</notes>
  	<notes behaviour="put">Thanks for using &lt;slash-edit/&gt;</notes>
  	<notes behaviour="see">This is the editor-view of your Document, internal links are not likely to work correctly.</notes>
  	<notes behaviour="dir">Please choose a Document to view in the editor</notes>
  	<notes behaviour="pre">Please confirm your changes</notes>
  
  <!-- The commands -->
  	<command behaviour="new" tip="Make a new Document" icon="new.gif">new(bravo)</command>
  	<command behaviour="get" tip="Edit this Document" icon="get.gif">get(bravo)</command>
  	<command behaviour="put">put(bravo)</command>
  	<command behaviour="see" tip="See this Document" icon="see.gif">see(bravo)</command>
  	<command behaviour="dir" tip="View Directory listing" icon="dir.gif">dir(bravo)</command>
  	<command behaviour="pre">pre(bravo)</command>
  
  <!-- text for form buttons -->	
  	<button behaviour="new" tip="This will create a new document at the location specified in the 'Save as' field">Make New Document</button>
  	<button behaviour="get" tip="View the result of your changes, without overwriting the original">Preview My Changes</button>
  	<button behaviour="pre" tip="Your changes will written">Yes</button>
  	<button behaviour="back" tip="You can re-edit the form">No</button>
  
  <!-- the tools available to each behaviour -->
  	<tools behaviour="new">
  		<tool command="dir"/>
  		<tool command="new"/>
  	</tools>
  	<tools behaviour="get">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="put">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="get"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="see">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="get"/>
  	</tools>
  	<tools behaviour="dir">
  		<tool command="new"/>
  	</tools>
  	<tools behaviour="pre">
  		<tool command="dir"/>
  		<tool command="new"/>
  		<tool command="see"/>
  	</tools>
  	<tools behaviour="error">
  		<tool command="dir"/>
  		<tool command="new"/>
  	</tools>
  
  <!-- what to call the parent directory link -->
  	<parent-dir tip="View Parent Directory listing">Parent ..</parent-dir>
  <!-- what to call new files -->
  	<default-new-file>new.xml</default-new-file>
  </config>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/schematron-page.xml
  
  Index: schematron-page.xml
  ===================================================================
  <?xml version="1.0" ?>
  <!--
  	Schematron schema for the slash-edit
  	
  	originally copied from work by:
  	Ivelin Ivanov, ivelin@iname.com
  -->
  	
  <schema ns="http://xml.apache.cocoon/page" xmlns="http://www.ascc.net/xml/schematron">
  	<title>Schema for &lt;slash-edit/&gt;</title>
  	
  	<pattern name="Simple Page (Structure)">
  		<rule context="page">
  			<assert  test="count(title) &gt; 0">There should be a title tag.</assert>
  			<assert  test="count(title) &lt; 2">There only should be one title tag.</assert>
  			<assert  test="count(content) &gt; 0">There should be one content tag.</assert>
  			<assert  test="count(content) &lt; 2">There only should be one content tag.</assert>
  		</rule>
  	</pattern>
  	<pattern name="Simple Page (Content)">
  		<rule context="title[1]">
  			<assert  test="string-length(.) &gt; 3">The title should be at least 4 characters.</assert>
  			<assert  test="string-length(.) &lt; 40">The title should be less than 40 characters.</assert>
  			<assert  test="text() != ' - please write your title here - '">Your title is a bit boring! ;-)</assert>
  		</rule>
  		<rule context="content[1]">
  			<assert test="para">There should be at least one para tag.</assert>
  			<assert test="para[1]/text() != ' - you can put in any number of paragraphs - '">Oh do try and make your content a little more interesting! ;-).</assert>
  		</rule>
  	</pattern>
  </schema>
  
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/slash-edit.css
  
  Index: slash-edit.css
  ===================================================================
  
      	.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;
      	}
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/template.xml
  
  Index: template.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <page>
   <title> - please write your title here - </title>
   <content>
    <para> - you can put in any number of paragraphs - </para>
   </content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/docs/welcome.xml
  
  Index: welcome.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <page>
   <title>&lt;slash-edit/&gt;</title>
   <content> <!-- Yea, I know, this file is crap, I could do better but my priority is new functionality ;) -->
   
   <para>
   	How to use &lt;slash-edit/&gt;
   		<para>
   			Top right you wil see some icons, this is &lt;slash-edit/&gt;'s toolbar. The icons look like this:
   		</para><para>
   			<img src="image/dir.gif"/> Gives you a Directory Listing of your current directory inside your project's 'docs' directory.
   		</para><para>
   			<img src="image/new.gif"/> Gives you a form, made from a template, for you to make a new file in the current directory.
   		</para><para>
   			<img src="image/get.gif"/> Gives you a form to edit this file.
   		</para><para>
   			<img src="image/see.gif"/> See this file in the editor, useful for proof reading etc.
   		</para><para>
   			There is no Delete function available, though you can overwrite files (no questions asked!).
   		</para><para>
   			If you need to make a new directory, add it's name to the path field when you go to save a file.
   		</para>
   </para>
  
   <para>
   	Sample Editors
   		<para>
   			<a href="dir(alpha)/"><b>Alpha Editor</b></a> - Uses the StreamGenerator to parse the Request, allowing you to edit the entire source XML as tags. 
   			No XML validation is available, if your XML is not well-formed, partial XML overwites the original!
   		</para>
   		<para>
   			<a href="new(bravo)/"><b>Bravo Editor</b></a> - Uses the RequestGenerator and XSLT to dissassemble a very simple doctype into seperate fields that can contain <b>no XML</b>.
   			&lt;para/&gt; tags in the source are converted to double line breaks in the form, then converted back to &lt;para/&gt; tags again on submit.
   			&lt;br/&gt; tags are converted to and from single line breaks, inside the paragraphs.
   			<b>Because of this simplistic approach</b>, this editor is unable to properly edit most of the files already in the docs directory
   			because they use nested &lt;para/&gt; and other tags. Nested paragraphs would become un-nested, other tags would be converted to Entities.
   			<b>Please make a new file first, when you try out this editor</b>.
   		</para>
   </para>
   
   <para>
  		To make use of it in your project, I envisage the following:
  		<para>
  			You add this to your project sitemap:
  			<pre>
  &lt;map:match pattern="edit**"&gt;
   &lt;map:mount uri-prefix="edit" src="editor.xmap" check-reload="yes"/&gt;
  &lt;/map:match&gt;
  			</pre>
  			<table>
  				<tr>
  					<td colspan="3">You copy to the root of your project (where the sitemap is) the following (from cocoon/samples/editor/) :</td>
  				</tr>
  				<tr>
  					<td>&#160;&#160;</td> <td>editor.xmap</td> <td>- the sitemap for the editor</td>
  				</tr>
  				<tr>
  					<td></td> <td>editor</td> <td>- a directory of the editor's files</td>
  				</tr>
  			</table>
  		</para>
  		<para>
  		You make adjustments to the editor.xmap incase your project's files do not reside in 'docs'.
  		</para><para>
  		You make any necessary adjustments to the template and schema in editor/docs to cope with the structure of the documents you use in your project (the samples use cocoon's 'simple-page' style).
  		</para><para>
  		You make any necessary adjustments to the stylesheets in editor/stylesheets to cope with the structure of the documents you use in your project (the samples use cocoon's 'simple-page' style).
  		</para><para>
  		You make any stylistic adjustments required to how the editors look.
  		</para><para>
  		You add an appropriate authentication mechanism to protect anything inside '/edit'.
  		</para><para>
  		That's the plan, anyway!
  		</para>
   	</para>
   <para>
   	Schema Validation
   		<para>
   			&lt;slash-edit/&gt; now uses Schematron to validate your XML.
   		</para><para>
   			Schematron allows you to write a simple xml file describing a set of rules your document should follow, and messages to send to the user when it does'nt.
   			This document gets transformed by Schematron's XSLT files into an XSLT that does the actual validation on your document. This process is handled dynamically by an internal pipeline, and gets cached appropriately.
   		</para><para>
  			When an error in validation occurs, &lt;slash-edit/&gt; now sends you back a form with some error messages, to try again. It still needs a lot of cleaning up though!
   		</para><para>
  			Many thanks to Ivelin Ivanov for his assistance in getting this working.
   		</para>
   </para>
    <para>
  		<table>
  			<tr>
  				<td colspan="3">Components Used:</td>
  			</tr>
  			<tr valign="top">
  				<td>&#160;&#160;</td><td>SourceWritingTransformer</td><td>Sends part of the SAX stream to a WriteableSource</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>DirectoryGenerator</td><td>Generates a directory listing</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>FileGenerator</td><td>Generates a SAX stream from a file</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>StreamGenerator</td><td>Generates XML by parsing a named form field in the Request</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>RequestGenerator</td><td>Generates XMLfrom the form fields in the Request, it does not Parse, so fields cannot contain XML.</td>
  			</tr>
  		</table>
    </para>
  		<table>
  			<tr>
  				<td colspan="4">commands:</td>
  			</tr>
  			<tr>
  				<td>&#160;&#160;</td><td>dir</td><td>your-project/edit/<b>dir(sub-editor)</b>/path/to/directory/</td><td>gives you a directory listing</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>see</td><td>your-project/edit/<b>see(sub-editor)</b>/path/to/file</td><td>lets you see your page within the editor (it is not going to look the same, outside the context of your project and links are unlikely to work)</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>get</td><td>your-project/edit/<b>get(sub-editor)</b>/path/to/file</td><td>converts the file into an HTML Form for editing</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>new</td><td>your-project/edit/<b>new(sub-editor)</b>/path/to/file</td><td>gives you a Form made from a template to make a new file at that location</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>put</td><td>your-project/edit/<b>put(sub-editor)</b></td><td>receives a Form, writing the contents back to File</td>
  			</tr>
  			<tr valign="top">
  				<td></td><td>pre</td><td>your-project/edit/<b>pre(sub-editor)</b></td><td>receives a Form, validates the instance, returns a form and a view of the data for you to confirm the modification</td>
  			</tr>
  		</table>
   </content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/images/dir.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/images/file.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/images/get.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/images/new.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/images/see.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/dir2editor.xsl
  
  Index: dir2editor.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:dir="http://apache.org/cocoon/directory/2.0"
   >
  
  	<xsl:include href="generation-utils.xsl"/>								<!-- utility templates and variables -->
  	<xsl:param name="target"/>
  	 
  	<xsl:template match="/">
  		<editor sub="{$sub}" command-base="{$command-base}">
  			<instance behaviour="dir" target="{$target}">
  				<xsl:copy>
  					<xsl:apply-templates select="@*|*"/>
  				</xsl:copy>
  			</instance>
  		</editor>
  	</xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/editor-alpha-components.xsl
  
  Index: editor-alpha-components.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  >
  
  
  <!-- your form for editing 'page' doctype content, handles the 'alpha' sub-editor for 'get' and 'new' behaviours -->
  
  	<xsl:template match="editor[@sub='alpha']/instance[@behaviour='get' or @behaviour='new']/page" mode="sub-editor">
  		<div class="block">
  			<span class="tab">Alpha Editor</span>
  			<div class="content">
  				<form method="post">
  					<xsl:attribute name="action"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'pre']"/></xsl:attribute>
  					<div class="block">
  						<span class="tab">File content</span>
  						<div class="field">
  							<textarea name="xml-field" rows="20" cols="80" xml:space="preserve" onchange="changed=true;"><xsl:apply-templates select="."/> </textarea>
  						</div>
  					</div>
  					<div class="block">
  						<span class="tab">Save as: </span>
  						<div class="field">
  							<input type="text" name="target" value="{$newfile}" size="40" title="Note: to make a new directory, prepend the filename with a directory path"/>
  						</div>
  					</div>
  					<div class="block" style="text-align:right">
  						<input class="submit" type="submit" value="{$config/button[@behaviour = $behaviour]}"/>
  					</div>
  				</form>
  			</div>
  		</div>
    </xsl:template>
  
  <!-- your template for previewing 'page' doctype content, handles the 'alpha' sub-editor for 'pre' behaviour -->
  	<xsl:template match="editor[@sub='alpha']/instance[@behaviour='pre']/page" mode="sub-editor">
  		<div class="block">
  			<span class="tab">Editor Preview</span>
  			<div class="content"><xsl:apply-templates mode="editor-view"/></div>
  		</div>
  		<div class="confirm">
  			<span class="tab">Confirm</span>
  			<div class="content" id="center">
  				<xsl:text>Are you sure you want to save these changes?</xsl:text>
  				<form method="post">
  					<xsl:attribute name="action"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'put']"/></xsl:attribute>
  					<textarea class="hidden" name="xml-field" xml:space="preserve" onchange="changed=true;"><xsl:apply-templates select="."/> </textarea>
  					<input name="target" type="hidden" value="{$newfile}"/>
  					<input type="button" value="{$config/button[@behaviour = 'back']}" onClick="history.back()" title="{$config/button[@behaviour = 'back']/@tip}" class="button"/> 
  					<span class="hspace"> </span>
  					<input name="{$config/button[@behaviour = $behaviour]}" class="submit" type="submit" title="{$config/button[@behaviour = $behaviour]/@tip}" value="{$config/button[@behaviour = $behaviour]}"/>
  				</form>	
  			</div>
  		</div>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/editor-bravo-components.xsl
  
  Index: editor-bravo-components.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:dir="http://apache.org/cocoon/directory/2.0"
   xmlns:source="http://apache.org/cocoon/source/1.0">
  
  <!-- your form for editing 'page' doctype content, handles the 'bravo' sub-editor for 'get' and 'new' behaviours -->
  	<xsl:template match="editor[@sub='bravo']/instance[@behaviour='get' or @behaviour='new']/page" mode="sub-editor">
  		<div class="block">
  			<span class="tab">Bravo Editor</span>
  			<div class="content">
  				<form method="post">
  					<xsl:attribute name="action"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'pre']"/></xsl:attribute>
  					<div class="block">
  						<span class="tab">Title</span>
  						<div class="field">
  							<input name="title" size="40"  onchange="changed=true;" value="{normalize-space(title)}"/>
  						</div>
  					</div>
  					<div class="block">
  						<span class="tab">Body</span>
  						<div class="field">
  							<textarea name="content" rows="20" cols="80" xml:space="preserve" onchange="changed=true;"><xsl:apply-templates select="content/*" mode="bravo"/> </textarea>
  						</div>
  					</div>
  					<div class="block">
  						<span class="tab">Save as</span>
  						<div class="field">
  							<input type="text" name="target" value="{$newfile}" size="40" title="Note: to make a new directory, prepend the filename with a directory path"/>
  						</div>
  						<div class="block" style="text-align:right">
  							<input class="submit" type="submit" value="{$config/button[@behaviour = $behaviour]}"/>
  						</div>
  					</div>						
  				</form>	
  			</div>
  		</div>
    </xsl:template>
  
  <!-- your template for previewing 'page' doctype content, handles the 'bravo' sub-editor for 'pre' behaviour -->
  	<xsl:template match="editor[@sub='bravo']/instance[@behaviour='pre']/page" mode="sub-editor">
  		<div class="block">
  			<span class="tab">Editor Preview</span>
  			<div class="content"><xsl:apply-templates mode="editor-view"/></div>
  		</div>
  		<div class="confirm">
  			<span class="tab">Confirm</span>
  			<div class="content" id="center">
  				<xsl:text>Are you sure you want to save these changes?</xsl:text>
  				<form method="post">
  					<xsl:attribute name="action"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'put']"/></xsl:attribute>
  					<input name="title" type="hidden" value="{normalize-space(title)}"/>
  					<textarea class="hidden" name="content" xml:space="preserve" onchange="changed=true;"><xsl:apply-templates select="content/*" mode="bravo"/> </textarea>
  					<input name="target" type="hidden" value="{$newfile}"/>
  					<input type="button" value="{$config/button[@behaviour = 'back']}" onClick="history.back()" title="{$config/button[@behaviour = 'back']/@tip}" class="button"/> 
  					<span class="hspace"> </span>
  					<input name="{$config/button[@behaviour = $behaviour]}" class="submit" type="submit" value="{$config/button[@behaviour = $behaviour]}"/>
  				</form>	
  			</div>
  		</div>
    </xsl:template>
  
  	<xsl:template match="b|i|a|strong|em|ul|ol|li" mode="bravo"><xsl:copy><xsl:apply-templates select="@*|*|text()"/></xsl:copy></xsl:template>
  
  	<xsl:template match="br" mode="bravo">
  		<xsl:text>
  </xsl:text>
  	</xsl:template><!---->
  
  	<xsl:template match="para" mode="bravo"><!-- strips 'br' tags, so they need a CR after them to survive! -->
  		<xsl:apply-templates mode="bravo"/>
  		<xsl:text>
  
  </xsl:text>
  	</xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/editor-components.xsl
  
  Index: editor-components.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:dir="http://apache.org/cocoon/directory/2.0"
   xmlns:source="http://apache.org/cocoon/source/1.0">
  
  
  <!-- generic behaviour templates -->
  
  	<xsl:template match="instance/*" mode="sub-editor">
  		<xsl:apply-templates select="."/>	
    </xsl:template>
  
  	<xsl:template match="instance[@behaviour='see']/page" mode="sub-editor">
  		<div class="block">
  			<span class="tab">Editor View</span>
  			<div class="content"><xsl:apply-templates mode="editor-view"/></div>
  		</div>
    </xsl:template>
  
  
  <!-- editor-view templates to display your doctype -->
  
  	<xsl:template match="content" mode="editor-view">
  		<div><xsl:apply-templates mode="editor-view"/></div>
    </xsl:template>
    
  	<xsl:template match="title" mode="editor-view">
  		<div class="title"><xsl:apply-templates/></div>
    </xsl:template>
    
  	<xsl:template match="para" mode="editor-view">
  		<p><xsl:apply-templates/></p>
    </xsl:template>
  
  
  <!-- Displays the directory listing -->
    <xsl:template match="dir:directory">
     <div class="block">
  		<span class="tab"><a href="../" title="{$config/parent-dir/@tip}"><b><xsl:value-of select="$config/parent-dir/text()"/></b></a></span>
  		<div class="content">
  			<table width="100%">
  				<xsl:apply-templates/>
  			</table>
  		</div>
     </div>
    </xsl:template>
  
  <!-- Displays sub-directories -->
    <xsl:template match="dir:directory/dir:directory">
     <tr>
     	<xsl:if test="position() mod 2 = 0"><xsl:attribute name="id">row</xsl:attribute></xsl:if>
     	<td>
     		<a href="{@name}/" title="{$config/command[@behaviour = 'dir']/@tip}">
        	<img src="{concat('image/',$config/command[@behaviour = 'dir']/@icon)}" border="0"/>
      	</a>
      	<a href="{@name}/" title="{$config/command[@behaviour = 'dir']/@tip}"><xsl:value-of select="@name"/></a>
      </td>
      <td>Directory</td>
      <td><xsl:value-of select="@date"/></td>
  	 </tr>
    </xsl:template>
  
  <!-- Displays files in the directory listing -->
    <xsl:template match="dir:file">
     <tr>
     	<xsl:if test="position() mod 2 = 0"><xsl:attribute name="id">row</xsl:attribute></xsl:if>
      <td>
       <a title="{$config/command[@behaviour = 'see']/@tip}">
        <xsl:attribute name="href"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'see']/text()"/><xsl:value-of select="$target"/><xsl:value-of select="@name"/></xsl:attribute>
        <img src="{concat('image/',$config/command[@behaviour = 'see']/@icon)}" border="0"/>
       </a>
       <a title="{$config/command[@behaviour = 'see']/@tip}">
        <xsl:attribute name="href"><xsl:value-of select="$command-base"/><xsl:value-of select="$config/command[@behaviour = 'see']/text()"/><xsl:value-of select="$target"/><xsl:value-of select="@name"/></xsl:attribute>
        <xsl:value-of select="@name"/>
       </a>
      </td>
      <td><xsl:value-of select="dir:xpath/title"/></td>
      <td><xsl:value-of select="@date"/></td>
     </tr>
    </xsl:template>
  
  	<xsl:template match="validationResult">
  		<div class="block">
  			<span class="tab">Schematron Validation</span>
  			<div class="content">
  				<table>
  					<xsl:for-each select="pattern">
  						<tr>
  							<td class="col1"><xsl:value-of select="@name"/></td>
  							<td class="col2">
  								<xsl:choose>
  									<xsl:when test="error">
  										<span class="failure">failure</span>
  									</xsl:when>
  									<xsl:otherwise><span class="success">success</span></xsl:otherwise>
  								</xsl:choose>
  							</td>
  						</tr>
  						<xsl:if test="error">
  							<xsl:for-each select="error">
  								<tr class="error">
  									<td/>
  									<td class="col1"> <xsl:value-of select="path"/></td>
  									<td class="col2"><xsl:value-of select="message"/></td>
  								</tr>				
  							</xsl:for-each>
  						</xsl:if>
  					</xsl:for-each>
  				</table>
  			</div>
  		</div>
    </xsl:template>
   
  <!-- outputs the response from SourceWritingTransformer -->
    <xsl:template match="sourceResult">
  		<div class="block">
  			<span class="tab">Writing to Source</span>
  			<div class="content">
  				<table>
  					<tr>
  						<td class="col1">Result</td>
  						<td class="col2"><span class="{execution}"><xsl:value-of select="execution"/></span></td>
  					</tr>
  					<tr>
  						<td class="col1">Behaviour</td>
  						<td class="col2"><xsl:value-of select="behaviour"/></td>
  					</tr>
  					<xsl:if test="message">
  						<tr>
  							<td class="col1">Message</td>
  							<td class="col2"><xsl:value-of select="message"/></td>
  						</tr>
  					</xsl:if>
  					<tr>
  						<td class="col1">Source</td>
  						<td class="col2"><xsl:value-of select="source"/></td>
  					</tr>
  					<tr>
  						<td class="col1">Action</td>
  						<td class="col2">
  							<xsl:choose>
  								<xsl:when test="action = 'none'">None taken</xsl:when>
  								<xsl:when test="action = 'new'">New document created</xsl:when>
  								<xsl:when test="action = 'overwritten'">Existing document overwritten</xsl:when>
  								<xsl:otherwise>Unknown</xsl:otherwise>
  							</xsl:choose>
  						</td>
  					</tr>
  					<xsl:if test="serializer">
  						<tr>
  							<td class="col1">Serializer</td>
  							<td class="col2"><xsl:value-of select="serializer"/></td>
  						</tr>
  					</xsl:if>
  				</table>
  			</div>
  		</div>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/editor-page2html.xsl
  
  Index: editor-page2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:sch="http://www.ascc.net/xml/schematron" 
   xmlns:zvon="http://zvon.org/schematron"
   xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0"
  
   >
  
  	<!-- 
  		This is the main Editor Stylesheet
  		It adapts itself to the particular command being sent in the structure of the XML.
  		It uses information stored in 'editor/docs/[sub-editor]-config.xml' to work out the commands, static strings etc.
  	-->
  	
  	<xsl:include href="editor-utils.xsl"/>								<!-- utility templates and variables -->
  	<xsl:include href="editor-components.xsl"/>						<!-- generic editor display templates -->
  	<xsl:include href="editor-alpha-components.xsl"/>			<!-- "alpha" sub-editor display templates -->
  	<xsl:include href="editor-bravo-components.xsl"/>			<!-- "bravo" sub-editor display templates -->
  	<!-- add your "sub-editors" here -->
  
  	<xsl:template match="slash-edit">
     <html>
     <head>
      <title><xsl:value-of select="$config/@title"/> - <xsl:value-of select="$config/title[@behaviour = $behaviour]"/> - <xsl:value-of select="$target"/></title>
      <xsl:if test="$is-form = 'true'">
  			<script lang="JavaScript"><![CDATA[
  				var changed = false;
  				function exit(to){
  					if (changed == true) {
  						if (confirm("Are you sure you want to loose your changes?")) {
  							document.location.href = to;
  						}
  					} else {
  						document.location.href = to;
  					}
  					//return false;
  				}]]>
  				<xsl:choose><!-- check user exiting, while the changes are still not saved -->
  					<xsl:when test="editor/validationResult/pattern/error">changed = true;</xsl:when>
  					<xsl:when test="$behaviour = 'pre'">changed = true;</xsl:when>
  				</xsl:choose>
  			</script>
      </xsl:if>
      
      <link type="text/css" rel="stylesheet" href="style"/>
  
      </head>
      <body> 
  			<div class="title"><xsl:value-of select="$config/@title"/> - site editor demo</div>
  			<div class="main">
  				<div class="head">
  					<div class="notify" id="left"><b><xsl:value-of select="$config/notify[@behaviour = $behaviour]"/> : </b> <xsl:value-of select="$target"/></div>
  					<div class="tools"><xsl:apply-templates select="$config/tools[@behaviour = $behaviour]"/></div>
  				</div>
  				<div class="block">
  					<xsl:apply-templates select="editor/validationResult"/>
  					<xsl:choose>
  						<!-- add your "sub-editors" here -->
  						<xsl:when test="editor[@sub = 'alpha']"><xsl:apply-templates select="editor/instance/*" mode="sub-editor"/></xsl:when>
  						<xsl:when test="editor[@sub = 'bravo']"><xsl:apply-templates select="editor/instance/*" mode="sub-editor"/></xsl:when>
  						<xsl:otherwise><div class="warning"><br/>Houston, we have a problem.<br/></div></xsl:otherwise>
  					</xsl:choose>
  				</div>
  				<div class="notes"><xsl:apply-templates select="$config/notes[@behaviour = $behaviour]"/></div>
  			</div>
  			<div class="foot">
  				&lt;!-- jeremy at apache dot org --&gt;<br/><br/>
  				Copyright &#169; 1999-2002 <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
  				All rights reserved.
  			</div>
   		</body>   
      
  
  <!--	debug	<table>
  				<tr>
  					<td>target</td> <td><xsl:value-of select="$target"/></td>
  				</tr>
  				<tr>
  					<td>command-base</td> <td><xsl:value-of select="$command-base"/></td>
  				</tr>
  				<tr>
  					<td>behaviour</td> <td><xsl:value-of select="$behaviour"/></td>
  				</tr>
  			</table> 	-->
  		<!-- / debug  -->
     </html>
    </xsl:template>
  
  <!-- output the tools for this page -->
  	<xsl:template match="tools">
  		<xsl:for-each select="tool">
  			<xsl:variable name="com" select="@command"/>
  			<xsl:variable name="command" select="$config/command[@behaviour = $com]"/>
  			<span class="tool">
  				<a title="{$command/@tip}">
  					<xsl:attribute name="href">
  						<xsl:if test="$is-form = 'true'"><xsl:text>javascript:exit('</xsl:text></xsl:if>
  						<xsl:choose>
  							<xsl:when test="$com = 'new'"><xsl:value-of select="$command-base"/><xsl:value-of select="$command/text()"/><xsl:value-of select="$newfile"/></xsl:when>
  							<xsl:otherwise><xsl:value-of select="$command-base"/><xsl:value-of select="$command/text()"/><xsl:value-of select="$target"/></xsl:otherwise>
  						</xsl:choose>
  						<xsl:if test="$is-form = 'true'"><xsl:text>');</xsl:text></xsl:if>
  					</xsl:attribute>
  					<img src="{concat('image/',$command/@icon)}" border="0"/>
  				</a>
  			</span>
  		</xsl:for-each>
  	</xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/editor-utils.xsl
  
  Index: editor-utils.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  >
  
  	<xsl:variable name="sub" select="/slash-edit/editor/@sub"/>
  	<xsl:variable name="command-base" select="/slash-edit/editor/@command-base"/>
  	<xsl:variable name="target" select="/slash-edit/editor/instance/@target"/>
  	<xsl:variable name="behaviour">
  		<xsl:choose>
  			<xsl:when test="/slash-edit/editor/instance/@behaviour !=''"><xsl:value-of select="/slash-edit/editor/instance/@behaviour"/></xsl:when>
  			<xsl:otherwise>error</xsl:otherwise>
  		</xsl:choose>
  	</xsl:variable>
  	
  <!-- the aggregated editor-config document -->
  	<xsl:variable name="config" select="/slash-edit/config"/>
  
  <!-- Do we have a form on this page? -->
  	<xsl:variable name="is-form">
  		<xsl:choose>
  			<xsl:when test="$behaviour = 'get' or $behaviour = 'new' or $behaviour = 'pre'">true</xsl:when>
  			<xsl:otherwise>false</xsl:otherwise>
  		</xsl:choose>
  	</xsl:variable>
  	
  <!-- what to give as the default name of a new file -->
  	<xsl:variable name="newfile">
  		<xsl:choose>
  			<xsl:when test="$target = '/'">/<xsl:value-of select="$config/default-new-file"/></xsl:when>
  			<xsl:when test="substring($target,string-length($target)) = '/'"><xsl:value-of select="$target"/><xsl:value-of select="$config/default-new-file"/></xsl:when>
  			<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
  			<xsl:otherwise>/<xsl:value-of select="$config/default-new-file"/></xsl:otherwise>
  		</xsl:choose>
  	</xsl:variable>
  
  <!-- copy anything -->
    <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/scratchpad/webapp/samples/editor/editor/stylesheets/editor2writer.xsl
  
  Index: editor2writer.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:sch="http://www.ascc.net/xml/schematron" 
   xmlns:zvon="http://zvon.org/schematron"
   xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0"
   >
  
  	<xsl:param name="base"/>
  
  <!-- 
  
  	This StyleSheet converts the output of the Validator and wraps it 
  	with 'source:write' tags, so the SourceWritingTransformer can save it
  	only if there have been no validation errors.
  
  	NB. the indentation of these templates effects the output document
  	
  	NB. it can get tricky to decide which namespaces need to be in which stylesheet, 
  	to make sure the wrong ones don't end up being written to source
  		
  -->
  
   
  <xsl:template match="editor">
  	<editor>
  		<xsl:copy-of select="@*"/>
  		<xsl:choose>
  			<xsl:when test="instance/@behaviour='put'">			
  				<instance behaviour="{instance/@behaviour}" target="{instance/@target}">
  					<source:write xml:space="preserve" xmlns:source="http://apache.org/cocoon/source/1.0">
  						<source:source><xsl:value-of select="$base"/><xsl:value-of select="instance/@target"/></source:source>
  						<source:fragment><xsl:apply-templates select="instance/*"/></source:fragment>
  					</source:write>
  				</instance>
  			</xsl:when>			
  			<xsl:otherwise>
  				<instance behaviour="{instance/@behaviour}" target="{instance/@target}">
  <xsl:apply-templates select="instance/*"/>
  				</instance>
  			</xsl:otherwise>
  		</xsl:choose>
  		<xsl:apply-templates select="validationResult"/>
  	</editor>
  </xsl:template>
  
  <!-- copy content ** this copies any tags into the source, when the source is re-parsed, they will be XML. **
  									** this is highly dangerous because no validation takes place !!!!!                      **
  	<xsl:template match="para"><para><xsl:value-of disable-output-escaping="yes" select="text()"/></para></xsl:template>
  	-->
  <!-- copy anything -->
    <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/scratchpad/webapp/samples/editor/editor/stylesheets/file2editor.xsl
  
  Index: file2editor.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
  	<xsl:include href="generation-utils.xsl"/>								<!-- utility templates and variables -->
  	<xsl:param name="target"/>
  
  	<xsl:template match="/">
  		<editor sub="{$sub}" command-base="{$command-base}">
  			<instance behaviour="{$behaviour}" target="{$target}">
  				<xsl:copy>
  					<xsl:apply-templates select="@*|*"/>
  				</xsl:copy>
  			</instance>
  		</editor>
  	</xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/generation-utils.xsl
  
  Index: generation-utils.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  >
  
  	<xsl:param name="sub"/>
  	<xsl:param name="behaviour"/>
  
  <!-- the relative base for commands -->
  	<xsl:variable name="command-base">
  	 <xsl:choose>
  		 <xsl:when test="$behaviour = 'put'"></xsl:when>
  		 <xsl:when test="$behaviour = 'pre'"></xsl:when>
  		 <xsl:otherwise>
  			<xsl:call-template name="find-base">
  			 <xsl:with-param name="path"><xsl:value-of select="$target"/></xsl:with-param>
  			</xsl:call-template>
  		 </xsl:otherwise>
  	 </xsl:choose>
  	</xsl:variable>
  
  <!-- find the command base, relative to the current folder -->
  	<xsl:template name="find-base">
  		<xsl:param name="path"/>
  		<xsl:param name="prefix"></xsl:param>
  		<xsl:choose>
  			<xsl:when test="contains($path,'/')">
  				<xsl:call-template name="find-base">
  					<xsl:with-param name="path"><xsl:value-of select="substring-after($path,'/')"/></xsl:with-param>
  					<xsl:with-param name="prefix"><xsl:value-of select="concat($prefix,'../')"/></xsl:with-param>
  				</xsl:call-template>
  			</xsl:when>
  			<xsl:otherwise><xsl:value-of select="$prefix"/></xsl:otherwise>
  		</xsl:choose>
  	</xsl:template>
  
  
  <!-- convert double CRs to 'para' tags -->
  <xsl:template name="cr2para">
   <xsl:param name="text"/>
   <xsl:choose>
    <xsl:when test="normalize-space(substring-before($text,'&#xD;&#xD;')) != ''">
    <para><xsl:call-template name="cr2br"><xsl:with-param name="text"><xsl:value-of select="substring-before($text,'&#xD;&#xD;')"/></xsl:with-param></xsl:call-template></para>
    <xsl:text>
    </xsl:text>
     <xsl:call-template name="cr2para">
      <xsl:with-param name="text"><xsl:value-of select="substring-after($text,'&#xD;&#xD;')"/></xsl:with-param>				
     </xsl:call-template>
    </xsl:when>
    <xsl:when test="normalize-space($text) != ''">
    <para><xsl:call-template name="cr2br"><xsl:with-param name="text"><xsl:value-of select="$text"/></xsl:with-param></xsl:call-template></para>
    </xsl:when>
   </xsl:choose>
  </xsl:template>
  
  <!-- convert single CRs to 'br' tags -->
  <xsl:template name="cr2br">
   <xsl:param name="text"/>
   <xsl:choose>
    <xsl:when test="normalize-space(substring-before($text,'&#xD;')) != ''">
  <xsl:value-of disable-output-escaping="yes" select="normalize-space(substring-before($text,'&#xD;'))"/><br/>
  <xsl:text>
  </xsl:text>
     <xsl:call-template name="cr2br">
      <xsl:with-param name="text"><xsl:value-of select="substring-after($text,'&#xD;')"/></xsl:with-param>				
     </xsl:call-template>
    </xsl:when>
    <xsl:when test="normalize-space($text) != ''"><xsl:value-of disable-output-escaping="yes" select="$text"/></xsl:when>
   </xsl:choose>
  </xsl:template>
  
  <!-- copy anything -->
    <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/scratchpad/webapp/samples/editor/editor/stylesheets/request2editor.xsl
  
  Index: request2editor.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0"
   >
  
  	<xsl:include href="generation-utils.xsl"/>								<!-- utility templates and variables -->
  	<xsl:variable name="target" select="request:request/request:requestParameters/request:parameter[@name = 'target']/request:value"/>
  
  <!-- 
  
  	This StyleSheet converts the output of the RequestGenerator into the new 'page'
  	then wraps it with 'editor' tags.
  	
  	It looks for double CRs in the submitted text and makes paragraphs from them using the 'para' tag.
  	It then looks inside the paragraphs for single CRs and inserts a 'br' tag if found.
  	
  	All other tags are saved as Entities.
  
  	NB. the indentation of these templates effects the output document
  		
  -->
  
  
  <xsl:template match="/">
  <editor sub="{$sub}" command-base="{$command-base}">
  <instance behaviour="{$behaviour}" target="{$target}">
  <page><xsl:text>
   </xsl:text><title><xsl:value-of select="request:request/request:requestParameters/request:parameter[@name = 'title']/request:value"/></title><xsl:text>
   </xsl:text><content><xsl:text>
    </xsl:text><xsl:call-template name="cr2para">
     <xsl:with-param name="text"><xsl:value-of select="translate(request:request/request:requestParameters/request:parameter[@name = 'content']/request:value,'&#x9;&#xA;','')"/></xsl:with-param>
    </xsl:call-template>
   </content><xsl:text>
  </xsl:text></page>
  </instance>
  </editor>
  </xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/schematron-extensions.xsl
  
  Index: schematron-extensions.xsl
  ===================================================================
  <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:sch="http://www.ascc.net/xml/schematron"
        xmlns:aaa="http://www.w3.org/1999/XSL/TransformAlias"
        xmlns:zvon="http://zvon.org/schematron">
  
  <xsl:template name="fullPath">
    <aaa:template match="*|@*" mode="fullPath">
      <aaa:apply-templates select="parent::*" mode="fullPath"/>
      <aaa:text>/</aaa:text>
      <aaa:if test="count(. | ../@*) = count(../@*)">@</aaa:if>
      <aaa:value-of select="name()"/>
      <aaa:if test="preceding-sibling::*[name()=name(current())] or following-sibling::*[name()=name(current())]">
        <aaa:text>[</aaa:text>
        <aaa:value-of select="1+count(preceding-sibling::*[name()=name(current())])"/>
        <aaa:text>]</aaa:text>
      </aaa:if>
    </aaa:template>
  </xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/schematron-validator2xsl.xsl
  
  Index: schematron-validator2xsl.xsl
  ===================================================================
  <!-- sch:key moved as a  child  of sch:schema and syntax changed to xslt usage -->
  <!-- 
    This stylesheet is derived from the original work of Miloslav Nic [ nicmila@systinet.com ] 
    http://www.zvon.org/xxl/SchematronTutorial/General/contents.html
  
    It is offered in its current form by Ivelin Ivanov [ ivelin@iname.com ]
  -->
  
  <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:sch="http://www.ascc.net/xml/schematron"
        xmlns:aaa="http://www.w3.org/1999/XSL/TransformAlias"
        xmlns:zvon="http://zvon.org/schematron">
  
  <xsl:import href="schematron-wrappers.xsl"/>
  <xsl:import href="schematron-extensions.xsl"/>
  
  
  
  <xsl:namespace-alias stylesheet-prefix="aaa" result-prefix="xsl"/>
  <xsl:output method="xml" indent="yes"/>
  
  <xsl:param name="outputMethod">xml</xsl:param>
  
  <!-- root of an XML Form document -->
  <xsl:variable name="docRoot">/editor/instance/*</xsl:variable>
  
  <xsl:key name="PHASE" match="sch:phase" use="sch:active/@pattern"/>
  
  <xsl:template name="sch-pattern">
      <xsl:apply-templates select="/sch:schema/sch:phase[@id=$phase]/sch:active[@pattern = current()/@id]"/>
      <xsl:apply-templates select="sch:p"/>
     
      <aaa:apply-templates select="." mode="{generate-id(.)}"/>
  </xsl:template>
  
  <xsl:template match="sch:pattern">
    <xsl:call-template name="patternWrapper"/>
  </xsl:template>
  
  <xsl:template match="sch:rule[not(@abstract='yes')]">
    <xsl:variable name="md" select="generate-id(parent::sch:pattern)"/>
  
    <aaa:template match="{@context}" mode="{$md}" priority="10">
      <xsl:apply-templates select="*|//sch:rule[@abstract='yes' and @id = current()/sch:extends/@rule]/*"/>
      <aaa:apply-templates select="*|@*" mode="{$md}"/>
    </aaa:template>
  </xsl:template>
  
  <xsl:template match="sch:key" mode="defineKey">
    <aaa:key name="{@name}" match="{@match}" use="{@use}"/>
    <!--   <aaa:key name="{@name}" match="{parent::sch:rule/@context}" use="{@path}"/> -->
  </xsl:template>
  
  <xsl:template match="sch:report | sch:assert">
    <xsl:variable name="startNOT">
      <xsl:if test="self::sch:assert">not(</xsl:if>
    </xsl:variable>
    <xsl:variable name="endNOT">
      <xsl:if test="self::sch:assert">)</xsl:if>
    </xsl:variable>
  
    <aaa:if test="{$startNOT}{@test}{$endNOT}">   
      <xsl:call-template name="reportAssertWrapper"/>
    </aaa:if>
  </xsl:template>
  
  <xsl:template match="@*" mode="addAttributes">
    <xsl:copy/>
  </xsl:template>
  
  <xsl:template match="sch:name">
    <xsl:choose>
      <xsl:when test="@zvon:fullPath='yes'">
        <aaa:apply-templates select="." mode="fullPath"/>
      </xsl:when>
      <xsl:otherwise><aaa:value-of select="name({@path})"/>
  </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <xsl:template match="sch:schema">
    <aaa:template match="{$docRoot}">
      <xsl:call-template name="documentWrapper"/> 
      <xsl:call-template name="schemaDiagnosticWrapper"/>
    </aaa:template>
    <xsl:apply-templates select="sch:pattern/sch:rule"/>
  </xsl:template>
  
  
  <xsl:template match="sch:schema" mode="process">
    <xsl:apply-templates select="sch:p | sch:pattern[$phase='#ALL'] | sch:pattern[key('PHASE',@id)/@id = $phase]"/>
  </xsl:template>
  
  
  <xsl:template match="sch:schema" mode="diagnostic">
    <xsl:apply-templates select="sch:diagnostics/sch:diagnostic"/>
    <xsl:apply-templates select="sch:pattern" mode="diagnostics"/>
  </xsl:template>
  
  <xsl:template match="sch:pattern" mode="diagnostics">
    
    <xsl:for-each select="sch:rule[sch:report/@diagnostics|sch:assert/@diagnostics]">
      <aaa:template match="{@context}" mode="dia_{generate-id(parent::sch:pattern)}" priority="10">
        <xsl:for-each select="sch:report[@diagnostics] | sch:assert[@diagnostics]">
  	<xsl:variable name="startNOT">
  	  <xsl:if test="self::sch:assert">not(</xsl:if>
  	</xsl:variable>
  	<xsl:variable name="endNOT">
  	  <xsl:if test="self::sch:assert">)</xsl:if>
  	</xsl:variable>
  	<aaa:if test="{$startNOT}{@test}{$endNOT}">   
  	  <xsl:call-template name='outputDiagnosticAssertReportWrapper'/>
  	</aaa:if>
        </xsl:for-each>
      </aaa:template>
    </xsl:for-each>
  </xsl:template>
  
  
  
  <xsl:template name="diagnosticItems">
    <xsl:param name="value"/>
    <xsl:variable name="start" select="substring-before($value,' ')"/>
    
    <xsl:choose>
      <xsl:when test="$start=''">
        <aaa:call-template name="diagnostic_{$value}"/>
      </xsl:when>
      <xsl:otherwise>
        <aaa:call-template name="diagnostic_{$start}"/>
        <xsl:call-template name="diagnosticItems">
  	<xsl:with-param name="value" select="substring-after($value,' ')"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  
  </xsl:template>
  
  <xsl:template match="sch:diagnostic">
    <aaa:template name="diagnostic_{@id}">
      <xsl:call-template name="diagnosticWrapper"/>
    </aaa:template>
  </xsl:template>
  
  <xsl:template match="sch:value-of">
    <aaa:value-of select="{@select}"/>
  </xsl:template>
  
  <xsl:template match="*"/>
  
  <xsl:template name='applyRules'>
    <aaa:apply-templates select="{$docRoot}" mode="{generate-id(.)}"/>
  </xsl:template>
  
  <xsl:template match="/">
    <aaa:stylesheet version="1.0" >
  
      <xsl:for-each select="/sch:schema/namespace::*">
        <xsl:variable name="prefix" select="name()"/>
        <xsl:if test="not($prefix='xml' or $prefix='')">
  	<xsl:attribute name="{$prefix}:{$prefix}" namespace="{.}">
  	  <xsl:value-of select="."/>
  	</xsl:attribute>
        </xsl:if>
      </xsl:for-each>
  
      <xsl:for-each select="/sch:schema/sch:ns">
        <xsl:if test="not(@prefix='xml' or @prefix='')">
  	<xsl:attribute name="{@prefix}:{@prefix}" namespace="{@uri}">
  	  <xsl:value-of select="@uri"/>
  	</xsl:attribute>
        </xsl:if>
      </xsl:for-each>
  
      <aaa:output method="{$outputMethod}" indent="yes"/>
  
  
        <xsl:apply-templates select="/sch:schema/sch:key" mode="defineKey"/>
        <xsl:apply-templates select="sch:schema"/>
  
        <xsl:for-each select="/sch:schema/sch:pattern">
  	<aaa:template match="text()" mode="{generate-id()}"/>
  
  	<aaa:template match="*|@*" mode="{generate-id()}">
  	  <aaa:apply-templates select="node()|@*" mode="{generate-id()}"/>
  	</aaa:template>
  
  	<aaa:template match="text()" mode="dia_{generate-id()}"/>
  
  	<aaa:template match="*|@*" mode="dia_{generate-id()}">
  	  <aaa:apply-templates select="node()|@*" mode="dia_{generate-id()}"/>
  	</aaa:template>
        </xsl:for-each>
  
        <aaa:template match="{$docRoot}" mode="startDiagnostics">
  	<xsl:for-each select="/sch:schema/sch:pattern">
  	  <aaa:apply-templates select="{$docRoot}" mode="dia_{generate-id(.)}"/>
  	</xsl:for-each>
        </aaa:template>
  
        <xsl:apply-templates select="sch:schema" mode="diagnostic"/>
  
        <xsl:call-template name="fullPath"/>
      </aaa:stylesheet>
  </xsl:template>
  
  <xsl:template match="sch:dir">
    <xsl:call-template name="dirWrapper"/>
  </xsl:template>
  
  <xsl:template match="sch:span">
    <xsl:call-template name="spanWrapper"/>
  </xsl:template>
  
  
  <xsl:template match="sch:p">
    <xsl:call-template name="pWrapper"/>
  </xsl:template>
  
  <xsl:template match="@icon">
    <xsl:call-template name="iconWrapper"/>
  </xsl:template>
  
  <xsl:template match="sch:emph">
    <xsl:call-template name="emphWrapper"/>
  </xsl:template>
  
  <xsl:template match="sch:title">
    <xsl:apply-templates/>
  </xsl:template>
  
  <xsl:param name="phase">
    <xsl:choose>
      <xsl:when test="/sch:schema/@defaultPhase">
        <xsl:value-of select="/sch:schema/@defaultPhase"/>
      </xsl:when>
      <xsl:otherwise>#ALL</xsl:otherwise>
    </xsl:choose>
  </xsl:param>
  
  <xsl:template match="sch:active">
    <xsl:apply-templates select="text() | sch:dir | sch:span | sch:emph"/>
  </xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/schematron-wrappers.xsl
  
  Index: schematron-wrappers.xsl
  ===================================================================
  <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:sch="http://www.ascc.net/xml/schematron"
        xmlns:aaa="http://www.w3.org/1999/XSL/TransformAlias"
        xmlns:zvon="http://zvon.org/schematron"
  >
  
  <!--
  	Schematron wrappers for the slash-edit
  	
  	originally copied from work by:
  	Ivelin Ivanov, ivelin@iname.com
  -->
  
  <!-- root of an XML Form document -->
  <xsl:variable name="docRootPrefix">/editor/instance/</xsl:variable>
  
  <xsl:template name="documentWrapper">
    <editor>
    	<aaa:copy-of select="../../@*"/> <!-- copy 'editor' attributes-->
      <instance>
      	<aaa:copy-of select="../@*"/> <!-- copy 'instance' attributes-->
        <aaa:copy-of select="."/>
      </instance>
      <validationResult>
        <xsl:apply-templates select="." mode="process"/>
      </validationResult>
    </editor>
  </xsl:template>
  
  <xsl:template name="schemaTitleWrapper">
    <xsl:if test="sch:title">
      <h2>
        <xsl:apply-templates select="sch:title"/>
      </h2>
    </xsl:if>
  </xsl:template>
  
  
  <xsl:template name="patternWrapper">
    <pattern name="{@name}">
      <xsl:call-template name="applyRules"/>
    </pattern>
  </xsl:template>
  
  
  <xsl:template name="reportAssertWrapper">
    <error>
      <path>
        <aaa:variable name="fpath">
          <aaa:apply-templates select="." mode="fullPath"/>
        </aaa:variable>
        <aaa:value-of select="substring-after($fpath, '{$docRootPrefix}')"/>
      </path>
      <message>
        <xsl:apply-templates/>
      </message>
    </error>
  </xsl:template>
  
  <xsl:template name="patternTitleWrapper">
    <tr>
      <th class="pattern">
        <a name="{@id}">&#160;</a>
        <xsl:text>Pattern: </xsl:text>
        <span class="patternTitle"><xsl:value-of select="@name"/></span>
      </th>
    </tr>
  </xsl:template>
  
  <xsl:template name="patternSeeWrapper">
    <xsl:if test="@see">
      <tr>
        <td>
  	<xsl:text>Documentation: </xsl:text>
  	<a href="{@see}"> see here </a>
        </td>
      </tr>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="pWrapper">
    <div>
  
      <xsl:copy-of select="@class|@id"/>
      <xsl:apply-templates select="@icon"/>
      <xsl:apply-templates/>
    </div>
  </xsl:template>
  
  <xsl:template name="iconWrapper">
    <img src="{.}"/>
  </xsl:template>
  
  <xsl:template name="emphWrapper">
    <em><xsl:apply-templates/></em>
  </xsl:template>
  
  <xsl:template name="spanWrapper">
    <span>
      <xsl:copy-of select="@class"/>
      <xsl:apply-templates/>
    </span>
  </xsl:template>
  
  <xsl:template name="dirWrapper">
    <span dir="{@value}">
      <xsl:apply-templates/>
    </span>
  </xsl:template>
  
  <xsl:template name="zvonDiagnostics-URI">
  
  </xsl:template>
  
  <xsl:template name="schemaDiagnosticWrapper">
    <xsl:choose>
      <xsl:when test="parent::*/@zvon:diagnostics-URI">
        <!--<saxon:output file="{parent::*/@zvon:diagnostics-URI}">-->
  	<aaa:apply-templates select="/" mode="startDiagnostics"/>
        <!--</saxon:output>-->
      </xsl:when>
      <xsl:otherwise>
        <aaa:message>
  	<aaa:apply-templates select="/" mode="startDiagnostics"/>
        </aaa:message>
      </xsl:otherwise>
    </xsl:choose>
    
  
  </xsl:template>
  
  <xsl:template name="outputDiagnosticAssertReportWrapper">
    <xsl:choose>
      <xsl:when test="@zvon:diagnostics-URI">
        <!--<saxon:output file="{@zvon:diagnostics-URI}">-->
  	<xsl:call-template name="diagnosticItems">
  	  <xsl:with-param name="value" select="normalize-space(@diagnostics)"/>
  	</xsl:call-template>
        <!--</saxon:output>-->
      </xsl:when>
      <xsl:otherwise>
  	<xsl:call-template name="diagnosticItems">
  	  <xsl:with-param name="value" select="normalize-space(@diagnostics)"/>
  	</xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template> 
  
  <xsl:template name="diagnosticWrapper">
    <xsl:text> 
  Diagnostics: 
  </xsl:text>
    <xsl:apply-templates/>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/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"
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  >
  
  <!-- this stylesheet is currently only used to display the editor/edit/welcome page -->
  
    <xsl:template match="page">
     <html>
      <head>
       <title>
        <xsl:value-of select="title"/>
       </title>
       <style><![CDATA[
  		 <!--
  				a{text-decoration:none}
  				a:hover{text-decoration:underline}
  				body{font-family : sans-serif,Arial,Tahoma;color:black;background-color : white;font-size:12px;} 
  				td{font-family : sans-serif,Arial,Tahoma;color:black;background-color : white;font-size:12px;} 
  		 //-->]]>
      </style>
      </head>
      <body bgcolor="white">
  		 <center>
       <h1>&#160;<xsl:value-of select="title"/> - site editor demo</h1>
       <table border="0" cellspacing="1" cellpadding="5" bgcolor="#0086B2" width="90%">
        <tr>
         <td class="notify"><b>Welcome to &lt;slash-edit/&gt;</b></td>
        </tr>
        <tr>
         <td bgcolor="white">
          <xsl:apply-templates/>
         </td>
        </tr>
        <tr>
         <td>
  				<table border="0" cellspacing="0" cellpadding="5" width="100%" bgcolor="white">
  					<tr>
  						<td class="notes">Thanks for trying &lt;slash-edit/&gt;</td>
  					</tr>
  				</table>
         </td>
        </tr>
       </table>
       </center>
       <p align="center">
       <font size="-1">
        Copyright &#169; 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="para">
     <p align="left">
      <xsl:apply-templates/>
     </p>
    </xsl:template>
  
    <xsl:template match="para/para">
    	<blockquote>
  		 <p align="left">
  			<xsl:apply-templates/>
  		 </p>
      </blockquote>
    </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/scratchpad/webapp/samples/editor/editor/stylesheets/stream2editor.xsl
  
  Index: stream2editor.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
  	<xsl:include href="generation-utils.xsl"/>								<!-- utility templates and variables -->
  	<xsl:param name="target"/>
  	
  <!-- 
  
  	This StyleSheet copies the output of the StreamGenerator into the 'editor'
  		
  -->
  	
  <xsl:template match="/">
  <editor sub="{$sub}" command-base="{$command-base}">
  <instance behaviour="{$behaviour}" target="{$target}">
  <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
  </instance>
  </editor>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/editor/stylesheets/validationFilter.xsl
  
  Index: validationFilter.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:sch="http://www.ascc.net/xml/schematron" 
   xmlns:zvon="http://zvon.org/schematron"
   xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0"
   >
  
  <!-- 
  
  	This StyleSheet changes the behaviour of the Editor if the output of the Validator contains errors.
  
  	NB. the indentation of these templates effects the output document
  	
  	NB. it can get tricky to decide which namespaces need to be in which stylesheet, 
  	to make sure the wrong ones don't end up being written to source
  		
  -->
  
  <xsl:variable name="behaviour">
  	<xsl:choose>
  		<xsl:when test="/editor/validationResult/pattern/error">get</xsl:when>			
  		<xsl:otherwise><xsl:value-of select="/editor/instance/@behaviour"/></xsl:otherwise>
  	</xsl:choose>
  </xsl:variable>
   
  <xsl:template match="editor">
  	<editor>
  		<xsl:copy-of select="@*"/>
  		<instance behaviour="{$behaviour}" target="{instance/@target}">
  <xsl:apply-templates select="instance/*"/>
  		</instance>
  		<xsl:apply-templates select="validationResult"/>
  	</editor>
  </xsl:template>
  
  <!-- copy anything -->
    <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/scratchpad/webapp/samples/editor/stylesheets/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"
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  >
  
    <xsl:param name="view-source"/>
  
    <xsl:template match="page">
     <html>
      <head>
       <title>
        <xsl:value-of select="title"/>
       </title>
  		 <style><![CDATA[
  		 <!--
  				a{text-decoration:none}
  				a:hover{text-decoration:underline}
  				body{font-family : sans-serif,Arial,Tahoma;color:black;background-color : white;} 
  				form{font-size:12px;background:#0086B2}
  				.notify{font-size:15px;}
  				.notes{font-size:12px;font-weight:bold;color:white;background:#0086B2}
  				.result{font-size:12px;color:black}
  				.failure{font-size:12px;font-weight:bold;color:red}
  				.counter{font-size:72px;font-weight:bold;color:gray}
  				.success{font-size:12px;font-weight:bold;color:green}
  				.caption{font-size:12px;font-weight:bold;color:black;}
  				textarea{font-size:12px;font-family : geneva,arial,sans-serif;}
  		 //-->]]>
  		 </style>
      </head>
      <body bgcolor="white" alink="red" link="blue" vlink="blue" style="font-family:trebuchet,arial,geneve,sans serif">
       <xsl:apply-templates/>
      </body>
     </html>
    </xsl:template>
  
  	<xsl:template match="title">
  		<h2 style="color: navy; text-align: center">
  			<xsl:choose>
  				<xsl:when test="$view-source">
  					<a>
  						<xsl:attribute name="href">../../../view-source?filename=samples/editor/<xsl:value-of select="$view-source"/></xsl:attribute>
  						<xsl:attribute name="target">source</xsl:attribute>
  						<xsl:apply-templates/>
  					</a>
  				</xsl:when>
  				<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
        </xsl:choose>     
  		</h2>
    </xsl:template>
  
    <xsl:template match="para">
     <p align="left">
      <xsl:apply-templates/>
     </p>
    </xsl:template>
  
  
    <xsl:template match="counter">
     <span class="counter"><xsl:value-of select="."/></span>
    </xsl:template>
  
    <xsl:template match="import">
     <blockquote style="color:green;">
      <xsl:apply-templates/>
     </blockquote>
    </xsl:template>
  
    <xsl:template match="sourceResult">
  		<table border="0" cellspacing="0" cellpadding="5" width="100%">
  			<tr>
  				<td class="caption">Behaviour</td>
  				<td class="result">
  					<xsl:value-of select="behaviour"/>
  				</td>
  			</tr>					
  			<tr>
  				<td class="caption">Result</td>
  				<td class="result">
  					<span class="{execution}">
  						<xsl:value-of select="execution"/>
  					</span>
  				</td>
  			</tr>
  			<tr>
  				<td class="caption">Message</td>
  				<td class="result">
  					<xsl:value-of select="message"/>
  				</td>
  			</tr>
  			<tr>
  				<td class="caption">Source</td>
  				<td class="result">
  					<xsl:value-of select="source"/>
  				</td>
  			</tr>
  			<xsl:if test="action">
  				<tr>
  					<td class="caption">Action</td>
  					<td class="result">
  						<xsl:choose>
  							<xsl:when test="action = 'none'">None taken</xsl:when>
  							<xsl:when test="action = 'new'">New file created</xsl:when>
  							<xsl:when test="action = 'overwritten'">Existing file overwritten</xsl:when>
  							<xsl:otherwise>Unknown</xsl:otherwise>
  						</xsl:choose>
  					</td>
  				</tr>
  			</xsl:if>
  			<xsl:if test="serializer">
  				<tr>
  					<td class="caption">Serializer</td>
  					<td class="result">
  						<xsl:value-of select="serializer"/>
  					</td>
  				</tr>
  			</xsl:if>
  		</table>
    </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/scratchpad/webapp/samples/editor/tests/include-me.xml
  
  Index: include-me.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
  	<title>Include me in Test Result 4</title>
  	<content>
  		<para>This is an external file that is to be XIncluded by 'test4' to make a new document.</para>
  		<para>
  			Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. 
  		</para><para>
  			Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
  		</para><para>
  			Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. 
  		</para><para>
  			Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
  		</para><para>
  			Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. 
  		</para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/make-page.xsl
  
  Index: make-page.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  >
  
    <xsl:template match="page">
    	<xsl:copy>
    		<xsl:apply-templates select="@*|node()"/>
    	</xsl:copy>
    </xsl:template>
  
    <xsl:template match="make-page">
    	<source:write>
  			<source:source>tests/result5.xml</source:source>
  			<source:fragment><page>
  	<title>Result from - <xsl:value-of select="/page/title"/></title>
  	<content>
  		<para>This file was assembled by XSLT from elements in <a target="source" href="../../../view-source?filename=samples/editor/tests/test5.xml">test5</a></para>
  		<para>Here are some paragraphs copied from there:
  			<import>
  				<xsl:for-each select="/page/content/para">
  					<xsl:copy><xsl:apply-templates/></xsl:copy>
  				</xsl:for-each>
  			</import>
  		</para>
  	</content>
  </page></source:fragment>
  		</source:write>
    </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/scratchpad/webapp/samples/editor/tests/result7.xml
  
  Index: result7.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  	<title>SourceWritingTransformer Test 7</title>
  	<content>
  		<para>This is the original paragraph</para>
  	</content>
  </page>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/result8.xml
  
  Index: result8.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  	<title>SourceWritingTransformer Test 8</title>
  	<content>
  		<para>This is the original paragraph</para>
  	</content>
  </page>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test1.xml
  
  Index: test1.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
  	<title>SourceWritingTransformer Test Page 1</title>
  	<content>
  		<para><b>Test</b>: Basic</para>
  		<para>This test should have written a file called result1.xml, in the same directory as this.</para>
  		<para>The file's content should come from the xml below.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  &lt;source:write&gt;
  	&lt;source:source&gt;tests/result1.xml&lt;/source:source&gt;
  	&lt;source:fragment&gt;&lt;page&gt;
  	&lt;title&gt;SourceWritingTransformer Test Result 1&lt;/title&gt;
  	&lt;content&gt;
  		&lt;para&gt;Congratulations!&lt;/para&gt;
  	&lt;/content&gt;
  &lt;/page&gt;&lt;/source:fragment&gt;
  &lt;/source:write&gt;
  			</pre>
  		</para>
  	
  <source:write xmlns:source="http://apache.org/cocoon/source/1.0">
  	<source:source>tests/result1.xml</source:source>
  <source:fragment><page>
  	<title>SourceWritingTransformer Test Result 1</title>
  	<content>
  		<para>Congratulations!</para>
  	</content>
  </page></source:fragment>
  </source:write>
  
  		<para>Have a <a href="../result/1">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test2.xml
  
  Index: test2.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page 
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  	
  >
  	<title>SourceWritingTransformer Test Page 2</title>
  	<content>
  		<para><b>Test</b>: Namespace</para>
  		<para>This test should have written a file called result2.xml, in the same directory as this.</para>
  		<para>The file's content should come from the xml below.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  &lt;source:write src=""&gt;
  	&lt;source:source&gt;tests/result2.xml&lt;/source:source&gt;
  	&lt;source:fragment&gt;&lt;page xmlns:xl="http://www.w3.org/1999/xlink"&gt;
  	&lt;title&gt;SourceWritingTransformer Test Result 2&lt;/title&gt;
  	&lt;content&gt;
  		&lt;para&gt;Congratulations!&lt;/para&gt;
  		&lt;para&gt;&lt;link xl:to="test/2"&gt;I am in the XLink NameSpace&lt;/link&gt;&lt;/para&gt;
  	&lt;/content&gt;
  &lt;/page&gt;&lt;/source:fragment&gt;
  &lt;/source:write&gt;
  			</pre>
  		</para>
  	
  		<para>The namespace is: http://www.w3.org/1999/xlink</para>
  	
  <source:write src="">
  	<source:source>tests/result2.xml</source:source>
  	<source:fragment><page xmlns:xl="http://www.w3.org/1999/xlink">
  	<title>SourceWritingTransformer Test Result 2</title>
  	<content>
  		<para>Congratulations!</para>
  		<para><link xl:to="test/2">I am in the XLink NameSpace</link></para>
  	</content>
  </page></source:fragment>
  </source:write>
  
  		<para>Have a <a href="../result/2">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test3.xml
  
  Index: test3.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page  page="blah"
  >
  	<title>SourceWritingTransformer Test Page 3!!!!!</title>
  	<content>
  		<para><b>Test</b>: New Folder Test</para>
  		<para>This test should have written a file called result3.xml, in a directory that did not originally exist.</para>
  		<para>The file's content should come from the xml below.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  &lt;source:write xmlns:source="http://apache.org/cocoon/source/1.0"&gt;
  	&lt;source:source&gt;tests/newfolder/result3.xml&lt;/source:source&gt;
  	&lt;source:fragment&gt;&lt;page&gt;
  	&lt;title&gt;SourceWritingTransformer Test Result 3&lt;/title&gt;
  	&lt;content&gt;
  		&lt;para&gt;Congratulations!&lt;/para&gt;
  	&lt;/content&gt;
  &lt;/page&gt;&lt;/source:fragment&gt;
  &lt;/source:write&gt;
  			</pre>
  		</para>
  		
  <source:write xmlns:source="http://apache.org/cocoon/source/1.0">
  	<source:source>tests/newfolder/result3.xml</source:source>
  	<source:fragment><page>
  	<title>SourceWritingTransformer Test Result 3</title>
  	<content>
  		<para>Congratulations!</para>
  	</content>
  </page></source:fragment>
  </source:write>
  
  		<para>Have a <a href="../result/newfolder/3">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test4.xml
  
  Index: test4.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page 
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  	xmlns:ci="http://apache.org/cocoon/include/1.0"
  >
  	<title>SourceWritingTransformer Test Page 4</title>
  	<content>
  		<para><b>Test</b>: XInclude Test</para>
  		<para>This test should have written a file called result4.xml, with the contents coming from the file  <a href="../../../view-source?filename=samples/editor/tests/include-me.xml" target="source">include-me.xml</a>.</para>
  		<para>The file's content is setup from the xml below.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  &lt;source:write&gt;
  	&lt;source:source&gt;tests/result4.xml&lt;/source:source&gt;
  	&lt;source:fragment&gt;&lt;ci:include src="tests/include.xml"/&gt;&lt;/source:fragment&gt;
  &lt;/source:write&gt;
  			</pre>
  		</para>
  		
  <source:write>
  	<source:source>tests/result4.xml</source:source>
  	<source:fragment><ci:include src="tests/include-me.xml"/></source:fragment>
  </source:write>
  
  		<para>Have a <a href="../result/4">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test5.xml
  
  Index: test5.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page>
  	<title>FileWritingTransformer Test Page 5</title>
  	<content>
  		<para><b>Test</b>: XSLT Test</para>
  		<para>This test should have written a file called result5.xml, with the contents being generated by a <a href="../../../view-source?filename=samples/editor/tests/make-page.xsl" target="source">StyleSheet</a>.</para>
  		<para>This also tests setting the serializer from the invocation of FileWritingTransformer in the SiteMap.</para>
  		<para>Anyway, the big issue here is that it is tricky to write XSL that gives you a clean XML indentation in your file. You can probably see how I have not quite got it right yet ;)</para>
  		<para>The file's content is setup from the xml below.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  			&lt;make-page/&gt;
  			</pre>
  		</para>
  		<make-page/>
  		<para>Have a <a href="../result/5">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test7.xml
  
  Index: test7.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page 
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  	
  >
  	<title>SourceWritingTransformer Test Page 7</title>
  	<content>
  		<para><b>Test</b>: Insert After</para>
  		<para>This test should have written a file called result7.xml, in the same directory as this.</para>
  		<para>The file's content should come from the xml below, being inserted after the original.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
  &lt;source:insert&gt;
  	&lt;source:path&gt;page/content&lt;/source:path&gt;
  	&lt;source:source&gt;tests/result7.xml&lt;/source:source&gt;
  	&lt;source:fragment&gt;&lt;para&gt;Congratulations!&lt;/para&gt;&lt;/source:fragment&gt;
  &lt;/source:insert&gt;
  			</pre>
  		</para>
  	
  	
  <source:insert>
  	<source:path>page/content</source:path>
  	<source:source>tests/result7.xml</source:source>
  	<source:fragment>
  		<para>Congratulations!</para>
  	</source:fragment>
  </source:insert>
  
  		<para>Have a <a href="../result/7">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test8.xml
  
  Index: test8.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <page 
  	xmlns:source="http://apache.org/cocoon/source/1.0"
  	
  >
  	<title>SourceWritingTransformer Test Page 8</title>
  	<content>
  		<para><b>Test</b>: Insert Before</para>
  		<para>This test should have written a file called result8.xml, in the same directory as this.</para>
  		<para>The file's content should come from the xml below. The paragraph should be inserted before the others.</para>
  		<para>The XML is:</para>
  		<para>
  			<pre>
    &lt;source:insert&gt;
      &lt;source:source&gt;tests/result8.xml&lt;/source:source&gt;
      &lt;source:path&gt;page&lt;/source:path&gt;
      &lt;source:replace&gt;content&lt;/source:replace&gt;
      &lt;source:reinsert&gt;content&lt;/source:reinsert&gt;
      &lt;source:fragment&gt;
        &lt;content&gt;
          &lt;p&gt;This new paragraph gets inserted &lt;emp&gt;before&lt;/emp&gt; the other ones.&lt;/p&gt;
        &lt;/content&gt;
      &lt;/source:fragment&gt;
    &lt;/source:insert&gt;
  			</pre>
  		</para>
  	
  	
    <source:insert>
      <source:source>tests/result8.xml</source:source>
      <source:path>page</source:path>
      <source:replace>content</source:replace>
      <source:reinsert>content</source:reinsert>
      <source:fragment>
  	<content>
  		<p>This new paragraph gets inserted <emp>before</emp> the other ones.</p>
  	</content>
      </source:fragment>
    </source:insert>
  
  		<para>Have a <a href="../result/8">look!</a></para>
  	</content>
  </page>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test6/inc.xsl
  
  Index: inc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <!-- Default template: copy node, and apply templates for all children -->
   <xsl:template match="*">
    <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:apply-templates/>
    </xsl:copy>
   </xsl:template>
  
   <!-- Specific template for foobar: increment the content of the node then copy itself with the new content -->
   <xsl:template match="counter">
    <xsl:variable name="contentNumber" select="number(.)"/>
    <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:value-of select="1+$contentNumber"/>
    </xsl:copy>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test6/input.xml
  
  Index: input.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  	<title>SourceWritingTransformer Test Page 6</title>
  	<content>
  		<para><b>Test</b>: Insert Replace</para>
  		<para>This test replicates <a href="9">test 9</a>, but does a <emp>write</emp>, using xslt to update the document.</para>
  		<para>This test should have incremented a counter in this file "tests/test6/input.xml".</para>
  		<para>The counter is: <counter>0</counter></para>
  		<para>Try <a href="../test/6">again</a>!</para>
  	</content>
  </page>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test6/prepareWrite.xsl
  
  Index: prepareWrite.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:source="http://apache.org/cocoon/source/1.0">
   <!-- Copies all the input tree into the input.xml file -->
   <xsl:template match="/">
  	<xsl:copy-of select="*"/>
  	<source:write> 
  	  <source:source>tests/test6/input.xml</source:source>		
  	  <source:fragment><xsl:copy-of select="*"/></source:fragment>		
  	</source:write>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test9/inc.xsl
  
  Index: inc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <!-- Default template: copy node, and apply templates for all children -->
   <xsl:template match="*">
    <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:apply-templates/>
    </xsl:copy>
   </xsl:template>
  
   <!-- Specific template for counter: increment the content of the node then copy itself with the new content -->
   <xsl:template match="counter">
    <xsl:variable name="contentNumber" select="number(.)"/>
    <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:value-of select="1+$contentNumber"/>
    </xsl:copy>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test9/input.xml
  
  Index: input.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  	<title>SourceWritingTransformer Test Page 9</title>
  	<content>
  		<para><b>Test</b>: Insert Replace</para>
  		<para>This test replicates <a href="6">test 6</a>, but this time doing an <emp>insert</emp> instead of a <emp>write</emp>.</para>
  		<para>This test should have incremented a counter in this file "tests/test9/input.xml".</para>
  		<para>The counter is: <counter>0</counter></para>
  		<para>
  			<pre>
  &lt;source:insert&gt;
  	&lt;source:source&gt;tests/test9/input.xml&lt;/source:source&gt;
  	&lt;source:path&gt;page/content/para[4]&lt;/source:path&gt;
  	&lt;source:replace&gt;counter&lt;/source:replace&gt;
  	&lt;source:fragment&gt;&lt;counter&gt;n&lt;/counter&gt;&lt;/source:fragment&gt;
  &lt;/source:insert&gt;
  			</pre>
  		</para>
  		<para>Try <a href="../test/9">again</a>!</para>
  	</content>
  </page>
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/editor/tests/test9/prepareWrite.xsl
  
  Index: prepareWrite.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:source="http://apache.org/cocoon/source/1.0">
  
  	<xsl:template match="/">
  		<page>
  			<xsl:apply-templates select="page/*"/>
  			<source:insert>
  				<source:source>tests/test9/input.xml</source:source>
  				<source:path>page/content/para[4]</source:path>
  				<source:replace>counter</source:replace>
  				<source:fragment><xsl:apply-templates select="/page/content/para[4]/counter"/></source:fragment>
  			</source:insert>
  		</page>
  	</xsl:template>
  	
  	<!-- copy anything -->
    <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/scratchpad/webapp/samples/paginator/README.txt
  
  Index: README.txt
  ===================================================================
  
  To get started, read the How-To for this component:
     http://localhost:8080/cocoon/howto/howto-paginator-transformer.html
  
  For those who don't like to read docs:
  
  Make sure you have a version 2.0.3 or greater of Cocoon. The PaginatorTransformer component source code is located in the scratchpad area. Therefore, you need to use the following command to build a deployable cocoon.war which includes the scratchpad libraries.
  
    ./build.[ sh | bat ] -Dinclude.scratchpad.libs=yes webapp 
  
  During the build process, the necessary configuration details for the PaginatorTransformer component are copied to cocoon.xconf of cocoon.war. This means that you don't need to manually configure cocoon.xconf.
  
  To get going, access:
        http://localhost:8080/cocoon/samples/paginator/list(1)
  
  Have fun!
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/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:transformers default="xslt">
     <map:transformer name="paginate" src="org.apache.cocoon.transformation.pagination.Paginator"/>
    </map:transformers>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
   </map:components>
  
   <map:pipelines>
    <map:pipeline>
   
     <map:match pattern="">
      <map:redirect-to uri="list(1)"/>
     </map:match>
  
     <map:match pattern="list">
      <map:generate src="content/list.xml"/>
      <map:transform src="stylesheets/list2html.xsl"/>
      <map:serialize type="html"/>
     </map:match>
  
     <map:match pattern="list(*)">
      <map:generate src="content/list.xml"/>
      <map:transform type="paginate" src="pagesheets/list.pagesheet">
        <map:parameter name="page" value="{1}"/>
      </map:transform>    
      <map:transform src="stylesheets/pagedlist2html.xsl"/>
      <map:serialize type="html"/>
     </map:match>
  
    </map:pipeline>
  
   </map:pipelines>
  
  </map:sitemap>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/content/list.xml
  
  Index: list.xml
  ===================================================================
  <list>
   <item>This is item 1</item>
   <item>This is item 2</item>
   <item>This is item 3</item>
   <item>This is item 4</item>
   <item>This is item 5</item>
   <item>This is item 6</item>
   <item>This is item 7</item>
   <item>This is item 8</item>
   <item>This is item 9</item>
  </list>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/pagesheets/list.pagesheet
  
  Index: list.pagesheet
  ===================================================================
  <?xml version="1.0"?>
  <pagesheet xmlns="http://apache.org/cocoon/paginate/1.0">
   <rules>
    <count type="element" name="item" num="4"/>
    <link type="unit" num="1"/>
   </rules>
  </pagesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/pagesheets/pagesheet.dtd
  
  Index: pagesheet.dtd
  ===================================================================
  <!-- ===================================================================
  
       Pagesheet DTD (Version 0.1)
  
  ==================================================================== -->
  
  <!ELEMENT pagesheet (items?, rules)*>
  <!ATTLIST pagesheet xmlns CDATA #IMPLIED>
  
  <!ELEMENT items (group)>
  
  <!ELEMENT group EMPTY >
  <!ATTLIST group 
     name CDATA #IMPLIED 
     element CDATA #IMPLIED >
  
  <!ELEMENT rules (link?, count?)*>
  
  <!ELEMENT link EMPTY >
  <!ATTLIST link 
     type ( unit | range ) #REQUIRED 
     num CDATA #REQUIRED 
   >
   
   <!ELEMENT count EMPTY >
   <!ATTLIST count 
     type ( element | char ) #REQUIRED 
     num CDATA #REQUIRED 
     name CDATA #IMPLIED 
     namespace CDATA #IMPLIED 
   >
  
  <!-- =============================================================== -->
  <!-- End of DTD -->
  <!-- =============================================================== -->
  
  
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/stylesheets/list2html.xsl
  
  Index: list2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="/">
     <html>
      <head>
       <title>Complete List</title>
      </head>
      <body bgcolor="white" alink="red" link="blue" vlink="blue">
       <h3>Complete List</h3>
       <xsl:apply-templates/>
      </body>
     </html>
    </xsl:template>
  
    <xsl:template match="list">
     <ul>
      <xsl:apply-templates/>
     </ul>
    </xsl:template>
  
    <xsl:template match="item">
     <li><xsl:apply-templates/></li>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/paginator/stylesheets/pagedlist2html.xsl
  
  Index: pagedlist2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <!DOCTYPE xsl:stylesheet [
   <!ENTITY laquo "&#xAB;" >
   <!ENTITY raquo "&#xBB;" >
   <!ENTITY nbsp "&#160;" >
  ]>
  
  <xsl:stylesheet version="1.0" 
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:page="http://apache.org/cocoon/paginate/1.0"
  >
  
    <xsl:template match="/">
     <html>
      <head>
       <title>Paged List</title>
      </head>
      <body bgcolor="white" alink="red" link="blue" vlink="blue">
       <h3>Paged List</h3>
       <xsl:apply-templates/>
       <a href="{//page:page/@clean-uri}">single page version</a>
      </body>
     </html>
    </xsl:template>
  
    <xsl:template match="list">
     <ul>
      <xsl:apply-templates/>
     </ul>
    </xsl:template>
  
    <xsl:template match="item">
     <li><xsl:apply-templates/></li>
    </xsl:template>
  
    <xsl:template match="page:page">
     <xsl:if test="@total &gt; 1">
  
        <!-- page navigation table -->
        <table border="0">
         <tr>
  
          <!-- td prev -->
          <td align="right">&nbsp;
           <xsl:if test="page:link[@type='prev']">
            <xsl:variable name="previous" select="@current - 1"/>
             <a href="{page:link[@page = $previous]/@uri}">&laquo; prev</a>
           </xsl:if>
          </td>
  
          <!-- td current -->
          <td align="center">
            [page <xsl:value-of select="@current"/> of <xsl:value-of select="@total"/>]
          </td>
  
          <!-- td next -->
          <td align="left">
           <xsl:if test="page:link[@type='next']">
            <xsl:variable name="next" select="@current + 1"/>
            <a href="{page:link[@page = $next]/@uri}">next &raquo;</a>
           </xsl:if>
          &nbsp;</td>
  
         </tr>
        </table>
  
     </xsl:if>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/README
  
  Index: README
  ===================================================================
  The Precept Stuff
  -----------------
  
  This is all still far from being ready for prime time but in order to share efforts I think
  it makes sense to have it in scratchpad. I'll give a short indroduction about the idea, the
  terms I am using, what is still missing, what should change and how I see its future.
  
  Installation
  ------------
  
  Add the roles and xconf snippet to you installation, set your precptor path (it's not yet
  resolved) mount the sitemap and access the url "app/demo.html" relative to the sitemap mount.
  
  
  Introduction
  ------------ 
  
  Form processing is always about collecting data of a specific structure. When this data
  selection process is finished the data will be used for some kind of purpose. Seeing this
  from a more concrete XMLish point of view one could say we are building some kind of XML
  instance which needs to conform to a schema description. That's exactly the major goal of
  this approach.
  
  
  The model
  ---------
  
  At the start of the flow we create some kind of instance that can hold our values. This
  instance will be held inside the users session until the end of form processing. In order to
  specify the structure and validation of the form data we need some kind of schema. Since
  "schema" is widely used as the short form for the w3.org XML Schema language I have chosen to
  use a different term that means schemas in general (XML Schema, relax-ng, etc.): "preceptors".
  In the first place the preceptor defines the structure of the instance but also holds 
  information about the value constraints. That's our model.
  
  
  The view
  --------
  
  Especially for multipage forms (sometimes called "wizards") it is quite obvious that only parts 
  of an instance are supposed to be displayed.
  
    [-----------------instance---------------]
    [---view1---][----view2----][----view3---]
  
  So we have different views of the instance. There are 2 different ways of achieving this. 
  (see webapp example1 and example2 for more details)
  
  
  The controller
  --------------
  
  The controller needs to populate request parameters into the instance and depending on the
  validation result select the correct following view. At the beginning I was quite optimistic
  this could all happen automagically - now I know better. I experienced two problems that are 
  not to solve automagically:
  
  1. checkboxes - Arrggh! This is the most stupid behavior I have ever seen... Anyway we have
     to deal with it. The only really working solution is that the controller "knows" when a 
     checkbox value is supposed to be in the request. Otherwise you cannot turn off your 
     checkboxes because a turned off checkbox will not appear in the request.
  
  2. partial validation - It's not true that you always want to validate a complete view.
     Never thought this would be necessary until some people showed me a real world example.
  
  The current approach is to bind methods to the form submit buttons. So you can define
  explicitly what should happen (populated, validated, which view is supposed to be shown) on a 
  specific button. So you are free to do whatever you want on a button click...
  
  
  This usually will happen inside an multiaction (maybe also within Ovidiu's schecoon?)
  
   ...
   public Map introspection(Redirector redirector, Sou...
      getLogger().debug("start of flow");
      // start of flow create session
      Session session = createSession(objectModel);
      // create instance
      Instance instance = createInstance("feedback");
      // save instance into session
      session.setAttribute("form-feedback",instance);
      // select first view
      return(page(VIEW1));
    }                                                                                                
   ...
   public Map doNext(Redirector redirector, Sou...
      getLogger().debug("populating");
      // populate a set of data into the instace
      populate(objectModel, "form-feedback", SET_INSTALLATION );
      // check if there are errors in those fields
      List errors = validate(objectModel, "form-feedback", SET_INSTALLATION );
      if(errors != null) {
        // errors - go back to last view
        getLogger().debug("some constraints FAILED");
        return (page(VIEW1));
      }
      else {
        // errors - go to next view
        getLogger().debug("all constraints are ok");
        return (page(VIEW2));
      }
    }                     
   ...
  
  
  The Instance
  ------------
  
  You can drop in any instance implementation that conforms to the following interface:
  
  public interface Instance extends Component {
    public void setValue(String xpath, Object value);
    public void setValue(String xpath, Object value, Context context);
  
    public Object getValue(String xpath);
  
    public List validate(String xpath, Context context);
    public List validate(Context context);
  
    public void setPreceptor( Preceptor preceptor );
    public Preceptor getPreceptor();
   
    public void toSAX( ContentHandler handler, boolean withConstraints);
    public long getLastModified();
  }                                       
  
  Note: I removed the Exceptions for this README. Please use the Instance.java as reference.
  
  Currently I have written a (very) simple dom implementation. (without namespace support or 
  any other features. More a simple tree. But should be quite fast)
  And the first step towards a BeanInstance. (Validation is missing and needs some more 
  discussion)
  
    ...
    <instance-impl>
      <component-instance name="dom" class="...">
      <component-instance name="bean" class="...">
        <class mapping="...">somwhere.my.bean</class>
      </component-instance>
    </instance-impl> 
    ...
  
  
  The Preceptor
  -------------
  
  A preceptor is usually some kind of wrapper around or interface to one of the well known
  validators. If you write a preceptor e.g. for XML Schema you can easily drop it in and 
  design your form within an XSD.
  
  public interface Preceptor extends Component {
    public List getConstraitsFor( String xpath );
    public boolean isValidNode( String xpath );
    public void buildInstance( Instance instance );
  } 
  
  Note: I removed the Exceptions for this README. Please use the Instance.java as reference.
  
  The mapping between the instance and the preceptor looks like this:
  
    <instances logger="webapp.validation">
      <!-- dom instance without validation -->
      <instance name="empty" impl="dom"/>
  
      <!-- dom instance with an easyrelax preceptor -->
      <instance name="feedback" impl="dom">
        <preceptor impl="easyrelax" uri="file:/D:/...../model/easyrelax.xml"/>
      </instance>
  
      <!--
      <instance name="form1" impl="dom">
        <preceptor impl="xsd" uri="..."/>
      </instance>
      <instance name="form2" impl="bean">
        <preceptor impl="relax-ng" uri="..."/>
      </instance>
      -->
    </instances>  
  
  
  The Constraint
  --------------
  
  A constraint restricts valid values of nodes inside the instance for a given context.  If we
  don't want to write our own constraints (and this should be the goal) we need to wrap
  existing ones into the Constraint Interface.
  
  public interface Constraint {
    public boolean isSatisfiedBy( Object value, Context context );
    public String getId();
    public String getType();
    public void toSAX(ContentHandler handler) throws SAXException;
  } 
  
  
  TODOs
  -----
  
  * make the easyrelax PreceptorBuilder use the parser component
  * put the easyrelax ConstraintFactory under CM control
  * use the real configuration values in the easyrelax constraints
  * implement the getLastModified in the simple dom instance
  * use the resolver to lookup the mapping for the bean instance
  * implement the validation for the bean instance
  * implement the getLastModified in the bean instance
  * maybe pass the validation result as request attribute to the
    instance transformer
  * discuss the selectMany instance representation
  * discuss schematron integration
  * implement the following tags in the instance transformer
      <textbox ref="xpath">
      <password ref="xpath">
      <selectOne ref="xpath">
      <selectMany ref="xpath">
      <selectBoolean ref="xpath">
      <output ref="xpath">
  
  
  
  The future
  ----------
  
  1) What I like to see in the future is a way to define simple form controllers not in java
     but in XML. This should be quite easy to achieve by writing an action taking an XML
     desciptor as configuration.
  
  2) A better multiaction integration in the sitemap. So those ugly action-set definitions go
     away.
  
  3) A tight integration with Schecoon
  
  4) Talk with with guys from Xerces2 (xsd) about the Preceptor stuff. IIRC they are about to
     rewrite some of the validation stuff anyway.
  
  5) Talk with the guys from Jing (relax-ng) about the Preceptor stuff. AFAICS they currently
     only have per document validation.
  
  6) add a toJavaScript() method to the Constraint interface so we can even generate JavaScript
     validation from the Constraints
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/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:transformers default="xslt">
        <map:transformer name="instance" src="org.apache.cocoon.precept.InstanceTransformer" logger="webapp.validation"/>
      </map:transformers>
      <map:actions>
        <map:action name="demoflow" src="org.apache.cocoon.precept.acting.PreceptorDemoAction" logger="webapp.validation"/>
      </map:actions>
      <map:readers default="resource"/>
      <map:serializers default="html"/>
      <map:selectors default="browser"/>
      <map:matchers default="wildcard"/>    
    </map:components>
  
    <map:action-sets>
      <map:action-set name="demo">
         <map:act type="demoflow"/>
         <map:act type="demoflow" action="prev1">
           <map:parameter name="method" value="prev1"/>
         </map:act>
         <map:act type="demoflow" action="prev2">
           <map:parameter name="method" value="prev2"/>
         </map:act>
         <map:act type="demoflow" action="prev3">
           <map:parameter name="method" value="prev3"/>
         </map:act>
         <map:act type="demoflow" action="prev4">
           <map:parameter name="method" value="prev4"/>
         </map:act>
         <map:act type="demoflow" action="next2">
           <map:parameter name="method" value="next2"/>
         </map:act>
         <map:act type="demoflow" action="next3">
           <map:parameter name="method" value="next3"/>
         </map:act>
         <map:act type="demoflow" action="next4">
           <map:parameter name="method" value="next4"/>
         </map:act>
         <map:act type="demoflow" action="submit">
           <map:parameter name="method" value="submit"/>
         </map:act>
      </map:action-set>
    </map:action-sets>
  
    <map:pipelines>
      <map:pipeline>
  
        <map:match pattern="**.html">
          <map:act type="request">
  
            <map:match pattern="app/**">
              <map:match pattern="**/example1.*">
                <map:act set="demo">
                  <map:generate src="example1/{page}.xml"/>
                  <map:transform type="instance"/>
                  <map:transform src="example1/{page}.xsl"/>
                  <map:serialize/>
                </map:act>
              </map:match>
            </map:match>
  
            <map:match pattern="app/**">
              <map:match pattern="**/example2.*">
                <map:act set="demo">
                  <map:generate src="example2/{page}.xml"/>
                  <map:transform type="instance"/>
                  <map:transform src="example2/i2html.xsl"/>
                  <map:serialize/>
                </map:act>
              </map:match>
            </map:match>
  
          </map:act>
        </map:match>
      </map:pipeline>
  
    </map:pipelines>
  </map:sitemap>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/snippet.roles
  
  Index: snippet.roles
  ===================================================================
  <?xml version="1.0" ?>
  <role-list>
    <role name="org.apache.cocoon.precept.InstanceFactory"
         shorthand="instances"
         default-class="org.apache.cocoon.precept.InstanceFactory"/>
   
    <role name="org.apache.cocoon.precept.InstanceSelector"
         shorthand="instance-impl"
         default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"
         default-hint="dom">
         <hint shorthand="dom" class="org.apache.cocoon.precept.stores.dom.simple.InstanceImpl"/>
         <hint shorthand="bean" class="org.apache.cocoon.precept.stores.bean.InstanceImpl"/>
    </role>
   
    <role name="org.apache.cocoon.precept.PreceptorBuilderSelector"
         shorthand="preceptor-impl"
         default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"
         default-hint="easyrelax">
         <hint shorthand="easyrelax" class="org.apache.cocoon.precept.preceptors.easyrelax.PreceptorBuilderImpl"/>
    </role>
  </role-list>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/snippet.xconf
  
  Index: snippet.xconf
  ===================================================================
  
    <instance-impl>
      <component-instance name="dom" class="org.apache.cocoon.precept.stores.dom.simple.InstanceImpl" logger="webapp.validation"/>
      <component-instance name="bean" class="org.apache.cocoon.precept.stores.bean.InstanceImpl" logger="webapp.validation">
        <class mapping="file:/...">somwhere.my.bean</class>
      </component-instance>
    </instance-impl>
  
    <preceptor-impl>
      <component-instance name="easyrelax" class="org.apache.cocoon.precept.preceptors.easyrelax.PreceptorBuilderImpl" logger="webapp.validation"/>
      <!--
      <component-instance name="relax-ng" class="..." logger="webapp.validation"/>
      <component-instance name="xsd" class="..." logger="webapp.validation"/>
      -->
    </preceptor-impl>
    
    <instances logger="webapp.validation">
      <instance name="empty" impl="dom"/>
      <instance name="feedback" impl="dom">
        <preceptor impl="easyrelax" uri="file:/D:/...../model/easyrelax.xml"/>
      </instance>
      <!--
      <instance name="form1" impl="dom">
        <preceptor impl="xsd" uri="..."/>
      </instance>
      <instance name="form2" impl="dom">
        <preceptor impl="relax-ng" uri="..."/>
      </instance>
      -->
    </instances>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/README
  
  Index: README
  ===================================================================
  This example always inserts the full instance into the SAX stream and uses
  the different stylesheets to display only parts of it.
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/error.xml
  
  Index: error.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     Sorry, submit failed
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/error.xsl
  
  Index: error.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><xsl:apply-templates/></body></html>
     </xsl:template>
        
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/thanks.xml
  
  Index: thanks.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     Successfully submitted your data!
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/thanks.xsl
  
  Index: thanks.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><xsl:apply-templates/></body></html>
     </xsl:template>
        
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view1.xml
  
  Index: view1.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     <i:insert-instance id="form-feedback"/>
     
     <!--
     <r:render>
        <f:label r:x="108" r:y="77" r:w="181" r:h="108">Name</f:label>
        <f:textbox ref="cocoon-user/name" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/surname" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/email" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/age" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/city" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/zip" r:x="108" r:y="77" r:w="181" r:h="108"/>
        <f:textbox ref="cocoon-user/number-of-projects" r:x="108" r:y="77" r:w="181" r:h="108"/>
  
        <f:selectOne ref="cocoon-user/position" preferred-presentation="combobox" r:x="108" r:y="77" r:w="181" r:h="108"/>
  
        <f:selectMany ref="cocoon-user/os" preferred-presentation="listbox" r:x="108" r:y="77" r:w="181" r:h="108"/>
  
        <f:selectBoolean ref="cocoon-user/like-it" preferred-presentation="checkbox" r:x="108" r:y="77" r:w="181" r:h="108"/>
  
        <f:button method="next" r:x="108" r:y="77" r:w="181" r:h="108">
           <f:caption>Next Page</f:caption>
           <f:hint>Click here to get to next page</f:hint>
        </f:button>
  
     </r:render>
     -->
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view1.xsl
  
  Index: view1.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
     </xsl:template>
     
     <xsl:template match="cocoon-installation">
       <table border="1">
       <tr>
         <td>Firstname</td>
         <td><input type="textbox" name="cocoon-installation/user/firstname" value="{user/firstname/text()}"/></td>
         <td><xsl:apply-templates select="user/firstname/constraint"/></td>
       </tr>
       <tr>
         <td>Lastname</td>
         <td><input type="textbox" name="cocoon-installation/user/lastname" value="{user/lastname/text()}"/></td>
         <td><xsl:apply-templates select="user/lastname/constraint"/></td>
       </tr>
       <tr>
         <td>Email</td>
         <td><input type="textbox" name="cocoon-installation/user/email" value="{user/email/text()}"/></td>
         <td><xsl:apply-templates select="user/email/constraint"/></td>
       </tr>
       <tr>
         <td>Age</td>
         <td><input type="textbox" name="cocoon-installation/user/age" value="{user/age/text()}"/></td>
         <td><xsl:apply-templates select="user/age/constraint"/></td>
       </tr>
       </table>
       <input type="submit" name="cocoon-action-next2" value="Next Page"/>     
     </xsl:template>
     
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view2.xml
  
  Index: view2.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     <i:insert-instance id="form-feedback"/>
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view2.xsl
  
  Index: view2.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
     </xsl:template>
     
     <xsl:template match="cocoon-installation">
       <table border="1">
       <tr>
         <td>Installation number</td>
         <td><input type="textbox" name="cocoon-installation/number" value="{number/text()}"/></td>
       </tr>
       <tr>
         <td>Live URL</td>
         <td><input type="textbox" name="cocoon-installation/live-url" value="{live-url/text()}"/></td>
       </tr>
       <tr>
         <td>Publish this URL</td>
         <td><input type="checkbox" name="cocoon-installation/publish" value="true">
                <xsl:if test="publish/text() = 'true'">
                  <xsl:attribute name="checked"/>
                </xsl:if>
             </input>
         </td>
       </tr>
       </table>
       <input type="submit" name="cocoon-action-prev1" value="Prev Page"/>     
       <input type="submit" name="cocoon-action-next3" value="Next Page"/>     
     </xsl:template>
     
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view3.xml
  
  Index: view3.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     <i:insert-instance id="form-feedback"/>
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view3.xsl
  
  Index: view3.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
     </xsl:template>
     
     <xsl:template match="cocoon-installation">
       <table border="1">
       <tr>
         <td>os</td>
         <td>
            <select name="cocoon-installation/system/os"> 
              <option value="linux">
                <xsl:if test="system/os = 'linux'">
                  <xsl:attribute name="selected"/>
                </xsl:if>
                Linux
              </option>
              <option value="w2k">
                <xsl:if test="system/os = 'w2k'">
                  <xsl:attribute name="selected"/>
                </xsl:if>
                Windows 2k
              </option>
            </select>          
         </td>
         <td><xsl:apply-templates select="system/os/constraint"/></td>
       </tr>
       <tr>
         <td>processor</td>
         <td><input type="textbox" name="cocoon-installation/system/processor" value="{system/processor/text()}"/></td>
         <td><xsl:apply-templates select="system/processor/constraint"/></td>
       </tr>
       <tr>
         <td>ram</td>
         <td><input type="textbox" name="cocoon-installation/system/ram" value="{system/ram/text()}"/></td>
         <td><xsl:apply-templates select="system/ram/constraint"/></td>
       </tr>
       <tr>
         <td>servlet engine</td>
         <td><input type="textbox" name="cocoon-installation/system/servlet-engine" value="{system/servlet-engine/text()}"/></td>
         <td><xsl:apply-templates select="system/servlet-engine/constraint"/></td>
       </tr>
       <tr>
         <td>java version</td>
         <td><input type="textbox" name="cocoon-installation/system/java-version" value="{system/java-version/text()}"/></td>
         <td><xsl:apply-templates select="system/java-version/constraint"/></td>
       </tr>
  
       </table>
       <input type="submit" name="cocoon-action-prev2" value="Prev Page"/>     
       <input type="submit" name="cocoon-action-next4" value="Next Page"/>     
     </xsl:template>
     
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view4.xml
  
  Index: view4.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     <i:insert-instance id="form-feedback"/>
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example1/view4.xsl
  
  Index: view4.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
  
  
     <xsl:template match="root">
       <html><body><form method="POST"><xsl:apply-templates/></form></body></html>
     </xsl:template>
     
     <xsl:template match="cocoon-installation">
       <table border="1">
  
       <tr>
         <td>Firstname</td>
         <td><xsl:value-of select="user/firstname/text()"/></td>
       </tr>
       <tr>
         <td>Lastname</td>
         <td><xsl:value-of select="user/lastname/text()"/></td>
       </tr>
       <tr>
         <td>Email</td>
         <td><xsl:value-of select="user/email/text()"/></td>
       </tr>
       <tr>
         <td>Age</td>
         <td><xsl:value-of select="user/age/text()"/></td>
       </tr>
  
       <tr>
         <td>Installation number</td>
         <td><xsl:value-of select="number/text()"/></td>
       </tr>
       <tr>
         <td>Live URL</td>
         <td><xsl:value-of select="live-url/text()"/></td>
       </tr>
       <tr>
         <td>Please publish it as cocoon live-site example</td>
         <td><xsl:value-of select="publish/text()"/></td>
       </tr>
  
       <tr>
         <td>os</td>
         <td><xsl:value-of select="system/os/text()"/></td>
       </tr>
       <tr>
         <td>processor</td>
         <td><xsl:value-of select="system/processor/text()"/></td>
       </tr>
       <tr>
         <td>ram</td>
         <td><xsl:value-of select="system/ram/text()"/></td>
       </tr>
       <tr>
         <td>servlet engine</td>
         <td><xsl:value-of select="system/servlet-engine/text()"/></td>
       </tr>
       <tr>
         <td>java version</td>
         <td><xsl:value-of select="system/java-version/text()"/></td>
       </tr>
  
  
       </table>
       <input type="submit" name="cocoon-action-prev3" value="Prev Page"/>     
       <input type="submit" name="cocoon-action-submit" value="Submit"/>     
     </xsl:template>
     
     <xsl:template match="/|*">
        <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/README
  
  Index: README
  ===================================================================
  This example use a more cleaner approach. The views are defined
  in XML and the stylesheet only renders into the desired media.
  Inserting of instance data will happen from within a transformer.
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/error.xml
  
  Index: error.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     Sorry, submit failed
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/i2html.xsl
  
  Index: i2html.xsl
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1" ?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
     <xsl:template match="/">
        <html>
           <body>
           <form method="POST">
              <xsl:apply-templates />
           </form>
           </body>
        </html>
     </xsl:template>
  
     <xsl:template match="i:output">
        [<xsl:value-of select="i:value/text()"/>]
     </xsl:template>
  
     <xsl:template match="i:textbox">
        <input name="{@ref}" type="textbox" value="{i:value/text()}" />
     </xsl:template>
  
     <xsl:template match="i:password">
        <input name="{@ref}" type="password" value="{i:value/text()}" />
     </xsl:template>
  
     <xsl:template match="i:selectBoolean">
        <input name="{@ref}" type="checkbox" value="true">
          <xsl:if test="i:value/text() = 'true'">
            <xsl:attribute name="checked"/>
          </xsl:if>
        </input>
     </xsl:template>
  
     <xsl:template match="i:selectOne">
       <select name="{@ref}">
         <xsl:variable name="selected" select="i:value/text()"/>
         <xsl:for-each select="constraint[@type = 'choice']/choice">
           <option value="{@value}">
             <xsl:if test="$selected = @value">
               <xsl:attribute name="selected"/>
             </xsl:if>
             <xsl:value-of select="."/>
           </option>
         </xsl:for-each>
       </select>
     </xsl:template>
  
     <xsl:template match="i:selectMany">
     </xsl:template>
  
     <xsl:template match="i:button">
        <input name="cocoon-action-{@method}" type="submit" value="{i:caption/text()}" />
     </xsl:template>
  
     <xsl:template match="*">
        <xsl:copy><xsl:copy-of select="@*" /><xsl:apply-templates /></xsl:copy>
     </xsl:template>
  
     <xsl:template match="text()">
        <xsl:value-of select="." />
     </xsl:template>
  </xsl:stylesheet>
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/thanks.xml
  
  Index: thanks.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <root xmlns:f="http://www.dff.st/dform"
        xmlns:r="http://www.dff.st/drender"
        xmlns:i="http://www.dff.st/ns/desire/instance/1.0"
        >
  
     Successfully submitted your data!
     
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/view1.xml
  
  Index: view1.xml
  ===================================================================
  <?xml version="1.0" ?>
  <root xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
    <errors>
      <i:insert-violations/>
    </errors>
  
    <i:instance id="form-feedback">
      <i:label>Firstname</i:label><i:textbox ref="cocoon-installation/user/firstname"/>
      <i:label>Lastname</i:label><i:textbox ref="cocoon-installation/user/lastname"/>
      <i:label>Email</i:label><i:textbox ref="cocoon-installation/user/email"/>
    </i:instance>
  
    <i:label>Age</i:label><i:textbox ref="cocoon-installation/user/age" instance="form-feedback"/>
    
  
    <i:button method="next2">
      <i:caption>Next</i:caption>
    </i:button>
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/view2.xml
  
  Index: view2.xml
  ===================================================================
  <?xml version="1.0" ?>
  <root xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
    <errors>
      <i:insert-violations/>
    </errors>
  
    <i:instance id="form-feedback">
      <i:label>Number of installations</i:label><i:textbox ref="cocoon-installation/number"/>
      <i:label>Live URL</i:label><i:textbox ref="cocoon-installation/live-url"/>
      <i:label>Publish</i:label><i:selectBoolean ref="cocoon-installation/publish"/>
    </i:instance>
  
    <i:button method="prev1">
      <i:caption>Prev</i:caption>
    </i:button>
  
    <i:button method="next3">
      <i:caption>Next</i:caption>
    </i:button>
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/view3.xml
  
  Index: view3.xml
  ===================================================================
  <?xml version="1.0" ?>
  <root xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
    <errors>
      <i:insert-violations/>
    </errors>
  
    <i:instance id="form-feedback">
      <i:label>OS</i:label><i:selectOne ref="cocoon-installation/system/os"/>
      <i:label>Processor</i:label><i:selectOne ref="cocoon-installation/system/processor"/>
      <i:label>RAM</i:label><i:textbox ref="cocoon-installation/system/ram"/>
      <i:label>Servlet Engine</i:label><i:selectOne ref="cocoon-installation/system/servlet-engine"/>
      <i:label>Java Version</i:label><i:selectOne ref="cocoon-installation/system/java-version"/>
    </i:instance>
  
    <i:button method="prev2">
      <i:caption>Prev</i:caption>
    </i:button>
  
    <i:button method="next4">
      <i:caption>Next</i:caption>
    </i:button>
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/example2/view4.xml
  
  Index: view4.xml
  ===================================================================
  <?xml version="1.0" ?>
  <root xmlns:i="http://www.dff.st/ns/desire/instance/1.0">
    <errors>
      <i:insert-violations/>
    </errors>
  
    <i:instance id="form-feedback">
      <i:label>Firstname</i:label><i:output ref="cocoon-installation/user/firstname"/>
      <i:label>Lastname</i:label><i:output ref="cocoon-installation/user/lastname"/>
      <i:label>Email</i:label><i:output ref="cocoon-installation/user/email"/>
  
      <i:label>Number of installations</i:label><i:output ref="cocoon-installation/number"/>
      <i:label>Live URL</i:label><i:output ref="cocoon-installation/live-url"/>
      <i:label>Publish</i:label><i:output ref="cocoon-installation/publish"/>
  
      <i:label>OS</i:label><i:output ref="cocoon-installation/system/os"/>
      <i:label>Processor</i:label><i:output ref="cocoon-installation/system/processor"/>
      <i:label>RAM</i:label><i:output ref="cocoon-installation/system/ram"/>
      <i:label>Servlet Engine</i:label><i:output ref="cocoon-installation/system/servlet-engine"/>
      <i:label>Java Version</i:label><i:output ref="cocoon-installation/system/java-version"/>
    </i:instance>
  
    <i:button method="prev3">
      <i:caption>Prev</i:caption>
    </i:button>
  
    <i:button method="submit">
      <i:caption>Submit</i:caption>
    </i:button>
  </root>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/precept/model/easyrelax.xml
  
  Index: easyrelax.xml
  ===================================================================
  <?xml version="1.0"?>
  <grammar xmlns="http://www.dff.st/ns/desire/easyrelax/grammar/1.0">
    <start>
      <element name="cocoon-installation">
  
        <!-- the user who installed cocoon -->
        <element name="user">
          <element name="firstname"/>
          <element name="lastname"/>
          <element name="email">
            <constraint type="regexpr" name="E_EMAIL">^[a-zA-Z0-9]+[a-zA-Z0-9-_.]*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$</constraint>
          </element>
          <optional>
            <element name="age"/>
            <element name="gender"/>
          </optional>
        </element>
  
        <!-- serial number of cocoon installation -->
        <element name="number"/>
  
        <!-- an optional live url -->
        <optional>
          <element name="live-url"/>
          <element name="publish"/>
        </optional>
  
        <!-- the system cocoon is running on -->
        <element name="system">
          <element name="os">
            <constraint type="choice" name="E_OS">
              <choice value="linux">Linux</choice>
              <choice value="w2k">Windows 2000</choice>
            </constraint>
          </element>
          <element name="processor">
            <constraint type="choice" name="E_PROCESSOR">
              <choice value="intel">Intel</choice>
              <choice value="powerpc">PowerPC</choice>
            </constraint>
          </element>
          <element name="ram"/>
          <element name="servlet-engine">
            <constraint type="choice" name="E_ENGINE">
              <choice value="tc4">Tomcat 4</choice>
              <choice value="tc3">Tomcat 3</choice>
              <choice value="resin">Resin</choice>
            </constraint>
          </element>
          <element name="java-version">
            <constraint type="choice" name="E_JAVA">
              <choice value="1.2">JDK 1.2.x</choice>
              <choice value="1.3">JDK 1.3.x</choice>
              <choice value="1.4">JDK 1.4.x</choice>
            </constraint>
          </element>        
        </element>
      </element>
    </start>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/README
  
  Index: README
  ===================================================================
  
  ====================================
    Using Jakarta Slide with Cocoon
  ====================================
  
  1. Install the Web Application via in Tomcat
  
   ./build.sh  -Dinclude.webapp.libs=yes -Dinstall.war=$TOMCAT_HOME/webapps -Dinclude.scratchpad.libs=yes install
  
  2. Start Tomcat
  
   $TOMCAT_HOME/bin/catalina.sh run
  
  3. Access the slide repository via Cocoon
  
   http://vernjava:8080/cocoon/samples/slide/browse/myrepository/ 
  
  [OPTIONAL]
  
  4. If you want an access via WebDAV copy the web.xml into WEB-INF/
     This file includes the WebDAV Servlet from Slide.
  
  5. Access WebDAV via MS WebFolders, Cadaver or what ever
  
   http://localhost:8080/cocoon/webdav/
  
  Have fun, Stephan Michels <stephan@vern.chem.tu-berlin.de>
  
  
  Some things must be fixed:
  
  * The base directory for the content stores should be set, but don't know how.
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/login-failed.html
  
  Index: login-failed.html
  ===================================================================
  <html>
   <head>
    <title>Login failed</title>
   </head>
   <body>
    <h3>Login failed!</h3>
   </body>
  </html>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/login.html
  
  Index: login.html
  ===================================================================
  <html>
   <head>
    <title>Login page</title>
   </head>
   <body>
    <form action="login" method="post">
     Username:<input name="name" type="text" size="25" maxlength="40"/><br/>
     Password:<input name="password" type="text" size="25" maxlength="40"/><br/>
     <input type="submit" name="login" value="Login"/>
    </form>
   </body>
  </html>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/logout.html
  
  Index: logout.html
  ===================================================================
  <html>
   <head>
    <title>Logout</title>
   </head>
   <body>
    <h3>You are logged out!</h3>
   </body>
  </html>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html.xsl
  
  Index: rdf2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                  xmlns:source="http://xml.apache.org/cocoon/source/1.0"
                  xmlns:dav="DAV:">
  
   <xsl:output indent="yes"/>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Jakarta Slide Collection</title>
     </head>
     <body>
      <xsl:apply-templates select="rdf:RDF/rdf:Description[1]"/>
     </body>
    </html>   
   </xsl:template>
  
   <xsl:template match="rdf:Description">
  
    <table width="90%" cellspacing="0" cellpadding="5" align="center">
     <tr>
      <td  bgcolor="#cccccc" colspan="5">
       <font size="+2">
        <strong>Subject&#160;&#160;<xsl:value-of select="@rdf:about"/>
        </strong>
       </font>
      </td>
     </tr>
     <tr>
      <td colspan="3" bgcolor="#eeeeee"><a href="/cocoon/samples/slide/browse/">Home</a></td>
      <td colspan="2" bgcolor="#eeeeee">
       <xsl:if test="dav:getcontentlength!='' and dav:getcontentlength!='0'">
        <xsl:if test="dav:resourcetype!='&lt;collection/>'">
         <a href="/cocoon/samples/slide/view/{@rdf:about}">Download</a>
        </xsl:if>
       </xsl:if>
      </td>
     </tr>
  
     <xsl:if test="source:branch!='' or source:revision!=''">
      <tr><td colspan="5" bgcolor="#ffffff">&#160;</td></tr>
      
      <tr>
       <td colspan="5">
        <table width="100%" cellspacing="0" cellpadding="5" align="center">
         <tr bgcolor="#cccccc">
          <td align="left" colspan="3"><tt><b>Revision</b></tt></td>
         </tr>
         <tr bgcolor="#cccccc">
          <td align="left"><tt><b>Branch</b></tt></td>
          <td align="left"><tt><b>Revision</b></tt></td>
         </tr>
  
         <tr bgcolor="#eeeeee">
          <td align="left"><tt><xsl:value-of select="source:branch"/></tt></td>
          <td align="left"><tt><xsl:value-of select="source:revision"/></tt></td>
         </tr>
        </table>
       </td>
      </tr>
  
     </xsl:if>
  
     <tr><td colspan="5" bgcolor="#ffffff">&#160;</td></tr>
  
     <tr>
      <td colspan="5">
       <table width="100%" cellspacing="0" cellpadding="5" align="center">
  
        <tr bgcolor="#cccccc">
         <td align="left" colspan="4"><tt><b>Properties</b></tt></td>
        </tr>
  
        <tr bgcolor="#cccccc">
         <td align="left"><tt><b>Namespace</b></tt></td>
         <td align="left"><tt><b>Name</b></tt></td>
         <td align="left"><tt><b>Value</b></tt></td>
         <td align="right"></td>
        </tr>
  
        <xsl:for-each select="*[local-name()!='children' and 
          local-name()!='permissions' and local-name()!='locks']">
         <tr bgcolor="#eeeeee">
          <td align="left"><tt><xsl:value-of select="namespace-uri(.)"/></tt></td>
          <td align="left"><tt><xsl:value-of select="local-name(.)"/></tt></td>
          <td align="left"><tt><xsl:value-of select="."/></tt></td>
          <td align="right">
           <!--<xsl:if test="@namespace!='DAV:'">-->
            <form action="" method="get">
             <input type="hidden" name="uri" value="{../@rdf:about}"/>
             <input type="hidden" name="namespace" value="{namespace-uri()}"/>
             <input type="hidden" name="name" value="{local-name()}"/>
   
             <input type="submit" name="cocoon-action-deleteproperty" value="Delete"/>
            </form>
           <!--</xsl:if>-->
          </td>
         </tr>
        </xsl:for-each>
  
        <tr bgcolor="#eeeeee">
         <form action="" method="get">
          <input type="hidden" name="uri" value="{@rdf:about}"/>
          <td align="left">
           <input name="namespace" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <input name="name" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <input name="value" type="text" size="25" maxlength="40"/>
          </td>
          <td align="right">
           <input type="submit" name="cocoon-action-addproperty" value="Add/Modify"/>
          </td>
         </form>
        </tr>
  
       </table>
      </td>
     </tr>
  
     <tr><td colspan="5" bgcolor="#ffffff">&#160;</td></tr>
  
     <tr>
      <td colspan="5">
       <table width="100%" cellspacing="0" cellpadding="5" align="center">
        <tr bgcolor="#cccccc">
         <td align="left" colspan="5"><tt><b>ACL Info</b></tt></td>
        </tr>
        <tr bgcolor="#cccccc">
         <td align="left"><tt><b>Subject</b></tt></td>
         <td align="left"><tt><b>Action</b></tt></td>
         <td align="left"><tt><b>Inheritable</b></tt></td>
         <td align="left"><tt><b>Deny</b></tt></td>
         <td align="right"></td>
        </tr>
  
        <xsl:apply-templates select="source:permissions/rdf:Seq/rdf:li/source:permission"/>
  
        <tr bgcolor="#eeeeee">
         <form action="" method="post">
          <input type="hidden" name="uri" value="{@rdf:about}"/>
          <td align="left">
           <input name="permissonsubject" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <input name="permissonaction" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <select name="permissoninheritable">
            <option>true</option>
            <option>false</option>
           </select>
          </td>
          <td align="left">
           <select name="permissondeny">
            <option>true</option>
            <option>false</option>
           </select>
          </td>
          <td align="right">
           <input type="submit" name="cocoon-action-addpermission" value="Add/Modify"/>
          </td>
         </form>
        </tr>
  
       </table>
      </td>
     </tr>
  
     <tr><td colspan="5" bgcolor="#ffffff">&#160;</td></tr>
  
     <tr>
      <td colspan="5">
       <table width="100%" cellspacing="0" cellpadding="5" align="center">
        <tr bgcolor="#cccccc">
         <td align="left" colspan="6"><tt><b>Lock Info</b></tt></td>
        </tr>
  
        <tr bgcolor="#cccccc">
         <td align="left"><tt><b>Subject</b></tt></td>
         <td align="left"><tt><b>Type</b></tt></td>
         <td align="left"><tt><b>Expiration</b></tt></td>
         <td align="left"><tt><b>Inheritable</b></tt></td>
         <td align="left"><tt><b>Exclusive</b></tt></td>
         <td align="right"></td>
        </tr>
  
        <xsl:apply-templates select="source:locks/rdf:Seq/rdf:li/source:lock"/>
  
        <tr bgcolor="#eeeeee">
         <form action="" method="post">
          <input type="hidden" name="uri" value="{@rdf:about}"/>
          <td align="left">
           <input name="locksubject" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <input name="locktype" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <input name="lockexpiration" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left">
           <select name="lockinheritable">
            <option>true</option>
            <option>false</option>
           </select>
          </td>
          <td align="left">
           <select name="lockexclusive">
            <option>true</option>
            <option>false</option>
           </select>
          </td>
          <td align="right">
           <input type="submit" name="cocoon-action-addlock" value="Add/Modify"/>
          </td>
         </form>
        </tr>
  
       </table>
      </td>
     </tr>      
  
     <tr><td colspan="5" bgcolor="#ffffff">&#160;</td></tr>
  
     <tr>
      <td colspan="5">
       <table width="100%" cellspacing="0" cellpadding="5" align="center">
        <tr bgcolor="#cccccc">
         <td align="left"><font size="+1"><strong>Child</strong></font></td>
         <td align="left"><font size="+1"><strong>Type</strong></font></td>
         <td align="left"><font size="+1"><strong>Size</strong></font></td>
         <td align="left"><font size="+1"><strong>Last Modified</strong></font></td>
         <td align="right"></td>
        </tr>
  
        <xsl:apply-templates select="source:children/rdf:Seq/rdf:li" mode="enumerate"/>
  
        <tr bgcolor="#eeeeee">
         <form method="post" enctype="multipart/form-data">
         <input type="hidden" name="uri" value="{@rdf:about}"/>
          <td align="left">
           <input name="filename" type="text" size="25" maxlength="40"/>
          </td>
          <td align="left" colspan="3">
           <input type="file" name="file" size="50" />
          </td>
          <td align="right">
           <input type="submit" name="cocoon-action-upload" value="Upload File" />
          </td>
         </form>
        </tr>
  
       </table>
      </td>
     </tr>
  
     <tr><td colspan="5">&#160;</td></tr>
     <tr><td colspan="5" bgcolor="#cccccc"><font size="-1">Jakarta Slide 1.0 + Apache Cocoon 2</font></td></tr>
    </table>
   </xsl:template>
  
  <!-- <xsl:template match="col:property">
    <tr bgcolor="#eeeeee">
     <td align="left"><tt><xsl:value-of select="@namespace"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@name"/></tt></td>
     <td align="left"><tt><xsl:value-of select="."/></tt></td>
     <td align="right">
      <xsl:if test="@namespace!='DAV:'">
       <form action="" method="get">
        <input type="hidden" name="uri" value="{../../../../source:uri}"/>
        <input type="hidden" name="propertynamespace" value="{@namespace}"/>
        <input type="hidden" name="propertyname" value="{@name}"/>
  
        <input type="submit" name="cocoon-action-deleteproperty" value="Delete"/>
       </form>
      </xsl:if>
     </td>
    </tr>
   </xsl:template>-->
  
   <xsl:template match="source:permission">
    <tr bgcolor="#eeeeee">
     <td align="left"><tt><xsl:value-of select="@subjecturi"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@actionuri"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@inheritable"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@negative"/></tt></td>
     <td align="right">
      <form action="" method="post">
       <input type="hidden" name="uri" value="{../../../../@uri}"/>
       <input type="hidden" name="permissionsubject" value="{@subject}"/>
       <input type="hidden" name="permissionsaction" value="{@action}"/>
  
       <input type="submit" name="cocoon-action-deletepermission" value="Delete"/>
      </form>
     </td>
    </tr>
   </xsl:template>
  
   <xsl:template match="source:lock">
    <tr bgcolor="#eeeeee">
     <td align="left"><tt><xsl:value-of select="@subject"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@type"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@expiration"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@inheritable"/></tt></td>
     <td align="left"><tt><xsl:value-of select="@exclusive"/></tt></td>
     <td align="right">
      <form action="" method="post">
       <input type="hidden" name="uri" value="{../../../../@uri}"/>
       <input type="hidden" name="locksubject" value="{@subject}"/>
  
       <input type="submit" name="cocoon-action-deletelock" value="Delete"/>
      </form>
     </td>
    </tr>
   </xsl:template>
  
   <xsl:template match="rdf:li" mode="enumerate">
    <tr bgcolor="#eeeeee">
     <td align="left">&#160;&#160;
      <a href="/cocoon/samples/slide/browse/{substring-after(@rdf:resource,'://')}"
        ><tt><xsl:value-of select="@rdf:resource"/></tt></a>
     </td>
     <xsl:variable name="location"><xsl:value-of select="@rdf:resource"/></xsl:variable>
     <td align="left"><tt></tt></td>
     <td align="left"><tt><xsl:value-of select="/rdf:RDF/rdf:Description[@rdf:about=$location]/dav:getcontentlength"/></tt></td>
     <td align="left"><tt><xsl:value-of select="/rdf:RDF/rdf:Description[@rdf:about=$location]/dav:etlastmodified"/></tt></td>
     <td align="right">
      <form action="" method="post">
       <input type="hidden" name="uri" value="{../../@rdf:about}"/>
       
       <input type="submit" name="cocoon-action-deletenode" value="Delete"/>
      </form>
     </td>
    </tr>
   </xsl:template>
  
  <!-- <xsl:template match="rdf:Description" mode="enumerate">
    <tr bgcolor="#eeeeee">
     <td align="left">&#160;&#160;
      <a href="/cocoon/samples/slide/browse/{source:uri}"><tt><xsl:value-of select="source:uri"/></tt></a>
     </td>
     <td align="left"><tt></tt></td>
     <td align="left"><tt><xsl:value-of select="dav:getcontentlength"/></tt></td>
     <td align="left"><tt><xsl:value-of select="dav:etlastmodified"/></tt></td>
     <td align="right">
      <form action="" method="post">
       <input type="hidden" name="uri" value="{source:uri}"/>
       
       <input type="submit" name="cocoon-action-deletenode" value="Delete"/>
      </form>
     </td>
    </tr>
   </xsl:template>-->
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/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:generator name="sourcedescription" 
                    src="org.apache.cocoon.generation.SourceDescriptionGenerator" 
                    logger="sitemap.generator.sourcedescriptiongenerator"
                    label="content"/>
    </map:generators>
  
    <map:transformers default="xslt">
     <map:transformer name="session" logger="sitemap.transformer.session"
                      src="org.apache.cocoon.webapps.session.transformation.SessionTransformer"/>
     <map:transformer logger="sitemap.transformer.write-source" name="write-source"
                      src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
    </map:transformers>
  
    <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" 
                     pool-grow="4" pool-max="32" pool-min="4" 
                     src="org.apache.cocoon.serialization.HTMLSerializer">
      <buffer-size>1024</buffer-size>
     </map:serializer>
    </map:serializers>
  
    <map:readers default="resource"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
  
    <map:actions>
     <map:action logger="sitemap.action.slide.upload" name="slide-upload"
                 src="org.apache.cocoon.acting.SourceUploadAction"/>
     <map:action logger="sitemap.action.slide.addproperty" name="slide-addproperty"
                 src="org.apache.cocoon.acting.SourceAddPropertyAction"/>
     <map:action logger="sitemap.action.slide.deleteproperty" name="slide-deleteproperty"
                 src="org.apache.cocoon.acting.SourceDeletePropertyAction"/>
     <map:action logger="sitemap.action.slide.deletecontent" name="slide-deletecontent"
                 src="org.apache.cocoon.acting.SourceDeleteContentAction"/>
  
     <map:action name="portal-auth" src="org.apache.cocoon.webapps.portal.acting.AuthAction"/>
  
     <map:action name="auth-protect" logger="sitemap.action.auth-protect" 
                 src="org.apache.cocoon.webapps.authentication.acting.AuthAction">
      <handlers>
       <handler name="slidehandler" xmlns:map="http://apache.org/cocoon/sitemap/1.0">
        <redirect-to    uri="cocoon://samples/slide/login.html"/>
        <authentication uri="cocoon://samples/slide/slide-authuser"/>
       </handler>
      </handlers>
     </map:action>
  
     <map:action name="auth-login" logger="sitemap.action.auth-login"
                 src="org.apache.cocoon.webapps.authentication.acting.LoginAction"/>
     <map:action name="auth-logout" logger="sitemap.action.auth-logout"
                 src="org.apache.cocoon.webapps.authentication.acting.LogoutAction"/>
     <map:action name="auth-loggedIn" logger="sitemap.action.auth-loggedIn"
                 src="org.apache.cocoon.webapps.authentication.acting.LoggedInAction"/>
  
    </map:actions>
  
   </map:components>
  
   <map:views>
    <map:view name="content" from-label="content">
     <map:transform src="context://samples/common/style/xsl/html/simple-xml2html.xsl"/>
     <map:serialize type="html">
      <encoding>ASCII</encoding>
     </map:serialize>
    </map:view>
  
    <map:view name="xml" from-label="content">
     <map:serialize type="xml">
      <encoding>ASCII</encoding>
     </map:serialize>
    </map:view>
   </map:views>
  
    <map:action-sets>
     <map:action-set name="slide-actions">
      <map:act action="upload"         type="slide-upload"/>
      <map:act action="addproperty"    type="slide-addproperty"/>
      <map:act action="deleteproperty" type="slide-deleteproperty"/>
      <map:act action="deletecontent" type="slide-deletecontent"/>
     </map:action-set>
    </map:action-sets>
  
   <map:pipelines>
  
  <!--  <map:pipeline>
     <map:match pattern="slide-*">
  
      <map:match pattern="slide-authuser">
       <map:generate type="slidecollection" src="myrepository/users"/>
       <map:transform src="resources/slideuser2user.xsl">
        <map:parameter name="use-request-parameters" value="true"/>
       </map:transform>
       <map:serialize type="xml"/>
      </map:match>
  
     </map:match>
  
     <map:handle-errors>
      <map:transform src="context://stylesheets/system/error2html.xsl"/>
      <map:serialize status-code="500"/>
     </map:handle-errors>
  
    </map:pipeline>-->
  
    <map:pipeline>
  
     <map:match pattern="">
  	  <map:redirect-to uri="browse/"/>
  	 </map:match>
   
  <!--   <map:match pattern="login.html">
      <map:read src="resources/login.html"/>
     </map:match>
  
     <map:match pattern="login">
      <map:act type="auth-login">
       <map:parameter name="handler" value="slidehandler"/>
       <map:parameter name="parameter_userid" value="request:name"/>
       <map:parameter name="parameter_password" value="request:password"/>
       <map:redirect-to uri="browse/myrepository/"/>
      </map:act>
  
      <map:generate src="resources/login-failed.html"/>
      <map:serialize/>
     </map:match>
  
     <map:match pattern="logout.html">
      <map:act type="auth-logout">
       <map:parameter name="handler" value="slidehandler"/>
  
       <map:read src="resources/logout.html"/>
      </map:act>
  
      <map:redirect-to uri="login.html"/>
     </map:match>
  
     <map:match pattern="**">
      <map:act type="auth-protect">
       <map:parameter name="handler" value="slidehandler"/>-->
  
       <map:match pattern="browse/**">
        <map:act set="slide-actions"/>
  
        <map:generate type="sourcedescription" src="slide://{1}?principal=root">
         <map:parameter name="repository" value="slide"/>
         <map:parameter name="namespace" value="myrepository"/>
         <map:parameter name="principal" value="root"/>
        </map:generate>
  
        <map:transform src="rdf2html.xsl">
         <map:parameter name="use-request-parameters" value="true"/>
         <!--<map:parameter name="namespace" value="{1}"/>-->
        </map:transform>
  
        <map:serialize type="html" mime-type="text/html"/>
       </map:match>
  
       <map:match pattern="view/**">
        <map:read src="slide://{1}?repository=slide&amp;namespace=myrepository&amp;principal=root"/>
       </map:match>
  
  <!--    </map:act>
     </map:match>-->
  
     <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/scratchpad/webapp/samples/slide/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  <?xml version="1.0"?>
  <slide default="myrepository">
  
   <namespace name="myrepository">
  
    <definition>
     <store name="jdbc">
  
      <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
       <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
       <parameter name="url">jdbc:hsqldb:slidestructure</parameter>
       <parameter name="user">sa</parameter>
       <parameter name="password"></parameter>
      </nodestore>
  
      <securitystore>
       <reference store="nodestore" />
      </securitystore>
  
      <lockstore>
       <reference store="nodestore" />
      </lockstore>
  
      <revisiondescriptorsstore>
       <reference store="nodestore" />
      </revisiondescriptorsstore>
  
      <revisiondescriptorstore>
       <reference store="nodestore" />
      </revisiondescriptorstore>
  
      <contentstore classname="slidestore.reference.JDBCContentStore">
       <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
       <parameter name="url">jdbc:hsqldb:slidecontent</parameter>
       <parameter name="user">sa</parameter>
       <parameter name="password"></parameter>
      </contentstore>
  
     </store>
     <scope match="/" store="jdbc" />
    </definition>
  
    <configuration>
     <!-- Actions mapping -->
     <default-action>/actions</default-action>
     <read-object>/actions/read</read-object>
     <create-object>/actions/write</create-object>
     <remove-object>/actions/write</remove-object>
     <grant-permission>/actions/manage</grant-permission>
     <revoke-permission>/actions/manage</revoke-permission>
     <read-permissions>/actions/manage</read-permissions>
     <lock-object>/actions/write</lock-object>
     <kill-lock>/actions/manage</kill-lock>
     <read-locks>/actions/read</read-locks>
     <read-revision-metadata>/actions/read</read-revision-metadata>
     <create-revision-metadata>/actions/write</create-revision-metadata>
     <modify-revision-metadata>/actions/write</modify-revision-metadata>
     <remove-revision-metadata>/actions/write</remove-revision-metadata>
     <read-revision-content>/actions/read</read-revision-content>
     <create-revision-content>/actions/write</create-revision-content>
     <modify-revision-content>/actions/write</modify-revision-content>
     <remove-revision-content>/actions/write</remove-revision-content>
  
     <!-- Paths configuration -->
     <userspath>/users</userspath>
     <guestpath>guest</guestpath>
     <filespath>/files</filespath>
     <parameter name="dav">true</parameter>
     <parameter name="standalone">true</parameter>
  
     <!-- Roles definition -->
     <role name="root">slideroles.basic.RootRole</role>
     <role name="user">slideroles.basic.UserRole</role>
     <role name="guest">slideroles.basic.GuestRole</role>
  
     <!-- Users management -->
     <auto-create-users>false</auto-create-users>
    </configuration>
     
    <data>
  
     <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
      <!-- Subject can be: self  "~"
                           all   "nobody"
                           user  "/users/john"
                           group "+/users/groupA"
                           role  "root"
        -->
      <!-- Uncomment the following line to give all permissions to
           principals have the root role -->
      <!-- <permission action="/actions" subject="root"/> -->
      <permission action="/actions" subject="/users/root"/>
      <permission action="/actions/read" subject="/users" inheritable="false"/>
      <permission action="/actions/read" subject="nobody" inheritable="false"/>
  
      <!-- /users -->
      <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users">
       <permission action="/actions" subject="~"/>
       <permission action="/actions" subject="/users/guest" inheritable="true" negative="true"/>
       <permission action="/actions/read" subject="/users" inheritable="false"/>
  
       <!-- Permission group example -->
       <objectnode classname="org.apache.slide.structure.GroupNode" uri="/users/groupA">
        <objectnode classname="org.apache.slide.structure.LinkNode" uri="/users/groupA/john" 
                    linkedUri="/users/john"/>
        <objectnode classname="org.apache.slide.structure.LinkNode" uri="/users/groupA/root"
                    linkedUri="/users/root"/>
        <objectnode classname="org.apache.slide.structure.SubjectNode"
                    uri="/users/groupA/singleGroupMember"/>
       </objectnode>
  
       <!-- /users/root represents the administrator -->
       <objectnode classname="slideroles.basic.RootRoleImpl" uri="/users/root">
        <revision>
         <property name="password">root</property>
        </revision>
       </objectnode>
   
       <!-- /users/john represents an authenticated user -->
       <objectnode classname="slideroles.basic.UserRoleImpl" uri="/users/john">
        <revision>
         <property name="password">john</property>
        </revision>
       </objectnode>
  
       <!-- /users/guest represents an authenticated or unauthenticated guest user -->
       <objectnode classname="slideroles.basic.GuestRoleImpl" uri="/users/guest">
        <revision>
         <property name="password"/>
        </revision>
       </objectnode>
      </objectnode>
  
      <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions">
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/read"/>
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write"/>
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/manage"/>
      </objectnode>
   
      <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/files">
       <permission action="/actions" subject="/users/guest"/> 
       <permission action="/actions/manage" subject="/users/john"/>
       <permission action="/actions/write" subject="+/users/groupA"/>
       <permission action="/actions/read" subject="nobody"/>
      </objectnode>
     </objectnode>
  
    </data>
  
   </namespace>
   
  </slide>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/web.xml
  
  Index: web.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!--
    This is the web-app configurations that allow Cocoon to work under
    Apache Tomcat. Please, follow the installation section of the
    documentation for more information about installing Cocoon on Tomcat
  -->
  
  <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
  
  <web-app>
    <display-name>Cocoon2 Demo</display-name>
    <description>Demo application for Cocoon2</description>
    <servlet>
      <servlet-name>Cocoon2</servlet-name>
      <display-name>Cocoon2</display-name>
      <description>The main Cocoon2 servlet</description>
  
      <!--
        In cases you're facing class loader problems you can alternatively
        use the following servlet-class instead of the normal one
  
        <servlet-class>org.apache.cocoon.servlet.ParanoidCocoonServlet</servlet-class>
  
      -->
      <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
  
      <!--
        This parameter points to the main configuration file for Cocoon.
        Note that the path is specified in absolute notation but it will be
        resolved relative to the servlets webapp context path
      -->
      <init-param>
        <param-name>configurations</param-name>
        <param-value>/WEB-INF/cocoon.xconf</param-value>
      </init-param>
  
      <!--
        This parameter tells cocoon to load all the required libraries into
        it's own classloader instead of trusting the Servlet Vendor's
        classloader.  If you experience strange classloader issues,
        try setting this parameter to "true".
      -->
      <init-param>
        <param-name>init-classloader</param-name>
        <param-value>false</param-value>
      </init-param>
  
      <!--
        This parameter indicates the configuration file of the LogKit management
      -->
      <init-param>
        <param-name>logkit-config</param-name>
        <param-value>/WEB-INF/logkit.xconf</param-value>
      </init-param>
  
      <!--
        This parameter indicates the category id of the logger from the LogKit
        configuration used by the CocoonServlet.
      -->
      <init-param>
        <param-name>servlet-logger</param-name>
        <param-value>access</param-value>
      </init-param>
  
      <!--
        This parameter indicates the category id of the logger from the LogKit
        management configuration for the Cocoon engine.
        This logger is used for all components described in the cocoon.xconf
        and sitemap.xmap file not having specified a logger with the
        logger="..." attribute in the component configuration file.
      -->
      <init-param>
        <param-name>cocoon-logger</param-name>
        <param-value>core</param-value>
      </init-param>
  
      <!--
        This parameter indicates the log level to use throughout startup of the system.
        As soon as the logkit.xconf the setting of the logkit.xconf configuration is
        used instead! Only for startup and if the logkit.xconf is not readable/available
        this log level is of importance.
  
        Available levels are:
          DEBUG:        prints all level of log messages.
          INFO:         prints all level of log messages except DEBUG ones.
          WARN:         prints all level of log messages except DEBUG and INFO ones.
          ERROR:        prints all level of log messages except DEBUG, INFO and WARN ones.
          FATAL_ERROR: prints only log messages of this level
      -->
      <init-param>
        <param-name>log-level</param-name>
        <param-value>DEBUG</param-value>
      </init-param>
  
      <!--
        Allow reinstantiating (reloading) of the cocoon instance. If this is
        set to "yes" or "true", a new cocoon instance can be created using
        the request parameter "cocoon-reload".
      -->
      <init-param>
        <param-name>allow-reload</param-name>
        <param-value>yes</param-value>
      </init-param>
  
      <!--
        This parameter is used to list classes that should be loaded
        at initialization time of the servlet.
        Usually this classes are JDBC Drivers used
      -->
      <init-param>
        <param-name>load-class</param-name>
        <param-value>
          <!-- For IBM WebSphere:
          com.ibm.servlet.classloader.Handler -->
  
          <!-- For Database Driver: -->
          org.hsqldb.jdbcDriver
  
          <!-- For parent ComponentManager sample:
          org.apache.cocoon.samples.parentcm.Configurator
          -->
        </param-value>
      </init-param>
  
      <!--
        This parameter allows to specify where Cocoon should put files
        which are uploaded by the upload.xsp sample. The path specified
        is always relative to the context path of the servlet.
        The default directory is "upload-dir" in the work-directory
  
      <init-param>
        <param-name>upload-directory</param-name>
        <param-value>/WEB-INF/work/upload-dir</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows to specify where Cocoon should put files
        which are cached by the storing class. The path specified
        is always relative to the context path of the servlet.
        The default directory is "cache-dir" in the work-directory
  
      <init-param>
        <param-name>cache-directory</param-name>
        <param-value>/WEB-INF/work/cache-dir</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows to specify where Cocoon should put it's
        working files. The path specified is always relative to the
        context path of the Cocoon servlet.
        Usually it is obtained from the servlet engine.
  
      <init-param>
        <param-name>work-directory</param-name>
        <param-value>/WEB-INF/work</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows to specify additional directories or jars
        which Cocoon should put into it's own classpath.
        Note that you must separate them using the platforms path.separator
        (":" for *nix and ";" for Windows systems). Also note that absolute
        pathes are take as such but relative pathes are rooted at the context
        root of the Cocoon servlet.
  
      <init-param>
        <param-name>extra-classpath</param-name>
        <param-value>WEB-INF/extra-classes1:/[YOU-ABSOLUTE-PATH-TO]/own.jar</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows you to select the parent component manager.
        The class will be instantiated via the constructor that takes a single
        String as a parameter. That String will be equal to the text after the
        '/'.
  
        Cocoon honors the Loggable and Initializable interfaces for this class,
        if it implements them.
  
        If you uncomment the following lines the parent CM is set to the Parent CM sample, which will look up
        a configuration via JNDI at org/apache/cocoon/samples/parentcm/ParentCMConfiguration
        and use it.
      <init-param>
        <param-name>parent-component-manager</param-name>
        <param-value>org.apache.cocoon.samples.parentcm.ParentComponentManager/org/apache/cocoon/samples/parentcm/ParentCMConfiguration</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows you to select the request factory. Possible choices are as follows:
            - org.apache.cocoon.components.request.MultipartRequestFactoryImpl
            - org.apache.cocoon.components.request.MaybeUploadRequestFactoryImpl
      -->
      <init-param>
        <param-name>request-factory</param-name>
        <param-value>org.apache.cocoon.components.request.MultipartRequestFactoryImpl</param-value>
      </init-param>
  
      <!--
        If you set this parameter to 'true' or 'yes', Cocoon will add processing
        time to the end of each response. Value 'hide' adds processing time as an HTML
        comment. By default, processing time is not added (corresponds to value 'no').
  
      <init-param>
        <param-name>show-time</param-name>
        <param-value>hide</param-value>
      </init-param>
      -->
  
      <!--
        This parameter allows you to startup Cocoon2 immediately after startup
        of your servlet engine.
      -->
      <load-on-startup>1</load-on-startup>
    </servlet>
  
    <servlet>
      <servlet-name>WebDAV</servlet-name>
      <display-name>WebDAV</display-name>
      <description>The WebDAV servlet</description>
  
      <servlet-class>org.apache.slide.webdav.WebdavServlet</servlet-class>
  
      <init-param>
        <param-name>scope</param-name>
        <param-value>/files</param-value>
        <description>
           Scope of the Slide namespace that should be exposed by this servlet.
           For example, if you want to expose only the /files collection via
           WebDAV, set this parameter to '/files'. In that case, any URLs of the
           form '/context-path/servlet-path/*' will be mapped to '/files/*'
           in the Slide namespace.
           The default value is an empty string.
        </description>
      </init-param>
  
      <init-param>
        <param-name>depth-limit</param-name>
        <param-value>3</param-value>
        <description>
           This init-parameter determines the depth limit for PROPFIND and other
           methods, to avoid performance hits on the server for requests with
           infinite depth.
           The default value is '3'.
        </description>
      </init-param>
  
      <init-param>
        <param-name>default-mime-type</param-name>
        <param-value>application/octet-stream</param-value>
        <description>
          The MIME type that should be used for resources of unknown type. For
          example, if a WebDAV client uploads a file (via PUT) without specifying
          the Content-Type header, the MIME type defined here will be used.
          The default value is 'application/octet-stream'.
        </description>
      </init-param>
  
      <init-param>
        <param-name>default-servlet</param-name>
        <param-value>false</param-value>
        <description>
          By default, the WebDAV servlet is mapped as default servlet of the
          web application context (the url-pattern in servlet-mapping is '/').
          If you want to change that mapping so the servlet is no longer the
          default servlet, you must change this initialization parameter to
          indicate the situation to the servlet, by setting it to 'false'.
          The default value is 'true'.
        </description>
      </init-param>
  
      <init-param>
        <param-name>domain</param-name>
        <param-value>/WEB-INF/Domain.xml</param-value>
        <description>
          Path to the domain configuration file, relative to the path of the
          web application.
          The default is '/Domain.xml'.
        </description>
      </init-param>
  
      <init-param>
        <param-name>namespace</param-name>
        <param-value>myrepository</param-value>
        <description>
          Name of the Slide namespace that should be accessed by this servlet.
          If this parameter is provided, make sure the corresponding namespace
          is defined in the domain configuration file. Otherwise, the default
          namespace will be used, if one exists.
        </description>
      </init-param>
  
      <init-param>
        <param-name>directory-browsing</param-name>
        <param-value>false</param-value>
        <description>
           Use the 'directory-browsing' init-parameter to turn off generation of
           HTML index pages that enable browsing of collections.
           The default value is 'true'. 
        </description>
      </init-param>
  
      <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
      </init-param>
  
      <load-on-startup>1</load-on-startup>
  
    </servlet>
  
  
    <!--
      Cocoon handles all the URL space assigned to the webapp using its sitemap.
      It is recommended to leave it unchanged. Under some circumstances though
      (like integration with proprietary webapps or servlets) you might have
      to change this parameter.
    -->
    <servlet-mapping>
      <servlet-name>Cocoon2</servlet-name>
      <url-pattern>/</url-pattern>
    </servlet-mapping>
    <!--
      Some servlet engines (Tomcat) have defaults which are not overriden
      by '/' mapping, but must be overriden explicitly.
    -->
    <servlet-mapping>
      <servlet-name>Cocoon2</servlet-name>
      <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>
    <!--
      Some servlet engines (WebLogic) have defaults which are not overriden
      by '/' mapping, but must be overriden explicitly.
    -->
    <servlet-mapping>
      <servlet-name>Cocoon2</servlet-name>
      <url-pattern>*.html</url-pattern>
    </servlet-mapping>
  
    <servlet-mapping>
      <servlet-name>WebDAV</servlet-name>
      <url-pattern>/webdav/*</url-pattern>
    </servlet-mapping>
  
    <mime-mapping>
      <extension>css</extension>
      <mime-type>text/css</mime-type>
    </mime-mapping>
  
    <!-- Authetication for the WebDAV servlet -->
    <security-constraint>
      <web-resource-collection>
        <web-resource-name>DAV resource</web-resource-name>
        <url-pattern>/webdav/*</url-pattern>
        <http-method>COPY</http-method>
        <http-method>DELETE</http-method>
        <http-method>GET</http-method>
        <http-method>HEAD</http-method>
        <http-method>LOCK</http-method>
        <http-method>MKCOL</http-method>
        <http-method>MOVE</http-method>
        <http-method>OPTIONS</http-method>
        <http-method>POST</http-method>
        <http-method>PROPFIND</http-method>
        <http-method>PROPPATCH</http-method>
        <http-method>PUT</http-method>
        <http-method>UNLOCK</http-method>
      </web-resource-collection>
      <auth-constraint>
        <role-name>root</role-name>
        <role-name>guest</role-name>
        <role-name>user</role-name>
      </auth-constraint>
    </security-constraint>
    
    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Slide DAV Server</realm-name>
    </login-config>
    
  </web-app>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message