<?xml version="1.0" encoding="UTF-8"?>

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

<!-- =========================== Components ================================ -->

	<map:components>
		<map:generators default="file">
			<map:generator name="xquery" 
                logger="sitemap.generator.xquery"
				src="org.exist.cocoon.XQueryGenerator">
            </map:generator>
		</map:generators>
	  	<map:readers default="resource"/>
	  	<map:serializers default="html"/>
	  	<map:selectors default="browser"/>
	  	<map:matchers default="wildcard"/>
	  	<map:transformers default="xslt">
	  	</map:transformers>
	</map:components>

<!-- =========================== Pipelines ================================= -->
 
	<map:pipelines>
		<map:pipeline>

            <map:match pattern="*.xml">
                <map:generate src="{1}.xml"/>
                <map:transform type="xinclude"/>
                <map:transform src="context://stylesheets/doc2html-2.xsl"/>
                <map:transform type="encodeURL"/>
                <map:serialize encoding="UTF-8" type="html"/>
            </map:match>
			<map:match pattern="test.xq">
				<map:generate src="test.xq" type="xquery">
					<map:parameter name="create-session" value="true"/>
				</map:generate>
				<map:serialize type="xml"/>
			</map:match>

            <map:match pattern="functions.xq">
                <map:generate src="functions.xq" type="xquery">
                	<map:parameter name="create-session" value="true"/>
                </map:generate>
                <map:transform type="xinclude"/>
                <map:transform src="stylesheets/functions.xsl"/>
                <map:transform src="context://stylesheets/db2html.xsl"/>
				<map:serialize encoding="UTF-8" type="html"/>
            </map:match>
            
			<map:match pattern="acronyms.xq">
				<map:generate src="acronyms.xq" type="xquery">
					<map:parameter name="use-request-parameters"
						value="true"/>
					<map:parameter name="create-session" value="true"/>
				</map:generate>
				<map:transform type="cinclude"/>
				<map:transform src="stylesheets/acronyms.xsl"/>
				<map:transform src="context://stylesheets/db2html.xsl"/>
				<map:serialize encoding="UTF-8" type="html"/>
			</map:match>

            <map:match pattern="biblio.xq">
                <map:generate src="biblio.xq" type="xquery">
                	<map:parameter name="create-session" value="true"/>
                </map:generate>
                <map:transform type="xinclude"/>
                <map:select type="request-parameter">
                    <map:parameter name="parameter-name" value="display"/>
                    <map:when test="details">
                        <map:transform src="stylesheets/detailed.xsl"/>
                    </map:when>
                    <map:otherwise>
                        <map:transform src="stylesheets/overview.xsl"/>
                    </map:otherwise>
                </map:select>
                <map:transform type="encodeURL"/>
                <map:serialize encoding="UTF-8" type="html"/>
            </map:match>

			<!--map:match pattern="secure.xq">
				<map:act src="xmldb:exist:///db" type="xmldb-login">
					<map:generate src="biblio.xq" type="xquery"/>
					<map:transform type="xinclude"/>
					<map:transform src="context://stylesheets/doc2html-2.xsl"/>
					<map:transform type="encodeURL"/>
                    <map:serialize encoding="UTF-8" type="html"/>
				</map:act>

				<map:generate src="login.xml"/>
				<map:transform type="xinclude"/>
				<map:transform src="context://stylesheets/doc2html-2.xsl"/>
				<map:transform type="encodeURL"/>
				<map:serialize type="html"/>
			</map:match-->

			<map:match pattern="*.xq">
                <map:generate src="{1}.xq" type="xquery">
                    <map:parameter name="create-session" value="true"/>
                    <map:parameter name="file" value="{1}.xq"/>
				</map:generate>
				<map:serialize encoding="UTF-8" type="html"/>
	        </map:match>
            
            <map:match pattern="source/*.xq">
                <map:read src="{1}.xq" mime-type="text/text"/>
            </map:match>

            <map:match pattern="**.xqm">
                <map:read src="{1}.xqm" mime-type="text/text"/>
            </map:match>

		</map:pipeline>
	</map:pipelines>

</map:sitemap>
