<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components ================================ -->
  <map:components>
<!-- =========================== Generators ================================= -->
    <map:generators default="file">
      <map:generator name="text" logger="sitemap.generator.textgenerator"
                  src="org.apache.cocoon.generation.TextGenerator">
        <parameter name="localizable" value="true"/>
      </map:generator>
      <map:generator name="exception"
                  src="org.apache.cocoon.generation.ParseExceptionGenerator"/>
    </map:generators>
<!-- =========================== Transformers ================================= -->
    <map:transformers default="xsltc">
      <map:transformer name="pattern" 
                    src="org.apache.cocoon.transformation.PatternTransformer" 
                    logger="sitemap.transformer.pattern">
        <parameter name="groups" value="true"/>
      </map:transformer>
      <map:transformer name="lexer" 
                    src="org.apache.cocoon.transformation.LexicalTransformer" 
                    logger="sitemap.transformer.lexer">
        <parameter name="localizable" value="true"/>
      </map:transformer>
      <map:transformer name="parser" 
                    src="org.apache.cocoon.transformation.ParserTransformer" 
                    logger="sitemap.transformer.parser">
        <parameter name="flatten" value="true"/>
        <parameter name="recovery" value="true"/>
        <parameter name="localizable" value="true"/>
      </map:transformer>
      <map:transformer name="extparser"
                    src="org.apache.cocoon.transformation.ExtendedParserTransformer"
                    logger="sitemap.transformer.extendedparser"></map:transformer>
    </map:transformers>
<!-- =========================== Selectors ================================ -->
    <map:selectors default="browser">
      <map:selector logger="sitemap.selector.exception" name="exception"
                 src="org.apache.cocoon.selection.ExceptionSelector">
        <exception name="syntax" class="net.sourceforge.chaperon.process.ParseException"/>
        <exception class="java.lang.Throwable" unroll="true"/>
      </map:selector>
    </map:selectors>
  </map:components>
<!-- =========================== Views =================================== -->
  <map:views>
    <map:view from-label="content" name="content">
      <map:serialize type="xml"/>
    </map:view>
    <map:view from-label="ast" name="ast">
      <map:serialize type="xml"/>
    </map:view>
    <map:view from-label="xdoc" name="xdoc">
      <map:serialize type="xml"/>
    </map:view>
    <map:view from-position="last" name="links">
      <map:serialize type="links"/>
    </map:view>
  </map:views>
<!-- =========================== Flow =================================== -->
  <map:flow language="javascript">
    <map:script src="misc/wiki.js"/>
  </map:flow>
<!-- =========================== Pipelines ================================= -->
  <map:pipelines>
    <map:pipeline type="caching" internal-only="true">
<!-- Hint: During development you could expose this pipeline, to help
     with writing your grammars. Use a text grammar myapp.grm and request
     the myapp.xlex and myapp.xgrm URLs and then view source.
   -->
      <map:match pattern="*.xlex">
        <map:generate  type="text"   src="grammars/{1}.grm"/>
        <map:transform type="lexer"  src="grammars/grm.xlex"/>
        <map:transform type="parser" src="grammars/grm.xgrm"/>
        <map:transform               src="stylesheets/text4regex.xsl"/>
        <map:transform type="lexer"  src="grammars/regex.xlex"/>
        <map:transform type="parser" src="grammars/regex.xgrm"/>
        <map:transform               src="stylesheets/grm2xlex.xsl"/>
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="*.xgrm">
        <map:generate  type="text"   src="grammars/{1}.grm"/>
        <map:transform type="lexer"  src="grammars/grm.xlex"/>
        <map:transform type="parser" src="grammars/grm.xgrm"/>
        <map:transform               src="stylesheets/text4regex.xsl"/>
        <map:transform type="lexer"  src="grammars/regex.xlex"/>
        <map:transform type="parser" src="grammars/regex.xgrm"/>
        <map:transform               src="stylesheets/grm2xgrm.xsl"/>
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="*.xegrm">
        <map:generate  type="text"   src="grammars/{1}.egrm"/>
        <map:transform type="extparser" src="grammars/egrm.xegrm"/>
        <map:transform               src="stylesheets/egrm2xegrm.xsl"/>
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="wiki/*.html">
        <map:generate  type="jx"      src="misc/{1}.xml" />
        <map:transform type="lexer"   src="cocoon:/wiki.xlex"/>
        <map:transform type="parser"  src="cocoon:/wiki.xgrm"         label="ast">
          <map:parameter name="failsafe" value="true"/>
        </map:transform>
        <map:transform                src="stylesheets/error4wiki.xsl"/>
        <map:transform type="lexer"   src="grammars/error.xlex"/>
        <map:transform                src="stylesheets/error2page.xsl"/>
        <map:transform                src="stylesheets/wiki2xdoc.xsl" label="xdoc"/>
        <map:transform                src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:match pattern="wiki/source.xml">
        <map:generate  type="jx"      src="misc/source.xml" />
        <map:transform type="lexer"   src="cocoon:/wiki.xlex"/>
        <map:transform type="parser"  src="cocoon:/wiki.xgrm"         label="ast"/>
        <map:transform                src="stylesheets/wiki2xdoc.xsl" label="xdoc"/>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>
    <map:pipeline type="caching">
      <map:match pattern="">
        <map:redirect-to uri="welcome"/>
      </map:match>
      <map:match pattern="welcome">
        <map:generate                src="misc/samples.xml"/>
        <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize/>
      </map:match>
      <map:match pattern="*.kont">
        <map:call continuation="{1}"/>
      </map:match>
      <map:match pattern="*.do">
        <map:call function="{1}"/>
      </map:match>
      <map:match pattern="*.css">
        <map:read src="misc/{1}.css"/>
      </map:match>
      <map:match pattern="**/*.css">
        <map:read src="misc/{2}.css"/>
      </map:match>
<!-- ========================= Chaperon ================================ -->
      <map:match pattern="mathexp.html">
        <map:generate type="serverpages" src="misc/mathexp.xsp"/>
        <map:transform type="lexer"   src="grammars/mathexp.xlex"/>
        <map:transform type="parser"  src="grammars/mathexp.xgrm"/>
        <map:transform                src="stylesheets/mathexp2html.xsl"/>
        <map:transform                src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:match pattern="quote*.html">
        <map:generate  type="text"    src="misc/quote{1}.txt"/>
        <map:transform type="lexer"   src="cocoon:/quote.xlex"/>
        <map:transform type="parser"  src="cocoon:/quote.xgrm" label="ast"/>
        <map:transform                src="stylesheets/quote2page.xsl"/>
        <map:transform                src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:match pattern="pattern.html">
        <map:generate                 src="misc/patterntext.xml"/>
        <map:transform type="pattern" src="grammars/link.xlex"/>
        <map:transform                src="stylesheets/pattern2link.xsl"/>
        <map:transform                src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:match pattern="**/*.java.html">
        <map:generate  type="text"    src="http://cvs.apache.org/viewcvs.cgi/*checkout*/cocoon-2.1/src/java/{1}/{2}.java"/>
        <map:transform type="lexer"   src="grammars/java.xlex"/>
        <map:transform                src="stylesheets/text4javadoc.xsl"/>
        <map:transform type="lexer"   src="grammars/javadoc.xlex" label="ast"/>
        <map:transform                src="stylesheets/java2html.xsl">
          <map:parameter name="package" value="{1}"/>
          <map:parameter name="class"   value="{2}"/>
        </map:transform>
        <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:match pattern="**/*.class.html">
        <map:generate  type="text"    src="http://cvs.apache.org/viewcvs.cgi/*checkout*/cocoon-2.1/src/java/{1}/{2}.java"/>
        <map:transform type="lexer"   src="grammars/java.xlex"/>
        <map:transform                src="stylesheets/remove4class.xsl"/>
        <map:transform type="parser"  src="cocoon:/java.xgrm"/>
        <map:transform                src="stylesheets/text4javadoc2.xsl"/>
        <map:transform type="lexer"   src="cocoon:/javadoc.xlex"/>
        <map:transform type="parser"  src="cocoon:/javadoc.xgrm" label="ast"/>
        <map:transform                src="stylesheets/class2html.xsl">
          <map:parameter name="package" value="{1}"/>
          <map:parameter name="class"   value="{2}"/>
        </map:transform>
        <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
          <map:parameter name="contextPath" value="{request:contextPath}"/>
        </map:transform>
        <map:serialize type="html"/>
      </map:match>
      <map:handle-errors>
        <map:select type="exception">
          <map:when test="syntax">
            <map:generate  type="exception"/>
            <map:transform                 src="stylesheets/text4error.xsl"/>
            <map:transform type="xinclude"/>
            <map:transform type="lexer"    src="grammars/error.xlex"/>
            <map:transform                 src="stylesheets/error2html.xsl">
              <map:parameter name="contextPath" value="{request:contextPath}"/>
            </map:transform>
            <map:serialize type="html"/>
          </map:when>
        </map:select>
      </map:handle-errors>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>
