<?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.
-->
<!-- ===============================================
Support for HOWTO documents that want 'revisions'.  Revisions are XML snippets containing
comments on the main XML file.  The main pipeline here automatically appends a page's
revisions to the bottom.

For example, in content/xdocs/community/howto/xmlform we have:

howto-xmlform.xml
revision-howto-xmlform-2002-05-20.xml
revision-howto-xmlform-2002-05-25.xml

The **/*.xml pipeline would append the revision-*.xml snippets to howto-xmlform.xml before
serving it.

Generates  :  Source XML
Example URL:  http://localhost:8888/community/howto/xmlform/howto-xmlform.xml
Used by    :  sitemap.xmap
Uses       :  content/xdocs/**.xml, and content/xdocs/**/revision-*.xml

$Revision: 1.2 $
==================================================== -->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:components>
    <map:generators default="file">
      <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" />
    </map:generators>
    <map:serializers default="html"/>
    <map:transformers default="xslt"/>
    <map:matchers default="wildcard"/>
  </map:components>
  <map:pipelines>
    <map:pipeline>
      <map:match pattern="**index.xml">
        <map:generate src="{properties:content.xdocs}{0}" />
        <map:transform type="idgen" />
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="**revision-*.xml">
        <map:generate src="{properties:content.xdocs}{1}revision-{2}.xml" />
        <map:transform type="idgen" />
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="**revisions-**">
        <map:generate type="directory" src="{properties:content.xdocs}{1}">
          <map:parameter name="dateFormat" value="yyyy-MM-dd hh:mm" />
        </map:generate>
        <map:transform src="{lm:transform.directory.revisions}">
          <map:parameter name="use-request-parameters" value="true" />
          <map:parameter name="page" value="{2}" />
        </map:transform>
        <map:serialize type="xml" />
      </map:match>
      <map:match pattern="**/*.xml">
        <map:aggregate element="all">
          <map:part src="{properties:content.xdocs}{0}" />
          <map:part src="cocoon:/{1}/revisions-{2}" />
        </map:aggregate>
        <map:transform src="{lm:transform.howto.document}" />
        <map:serialize type="xml-document" />
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>
