forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Wheller <s...@inwords.co.za>
Subject Help with sitemap.xmap - Docbook Plugin
Date Thu, 28 Oct 2004 11:47:06 GMT
Hi,

Trying to devise a "sitemap.xmap" for the Docbook plug-in. I'm not to hot with 
all the syntax for sitemaps and how it works exactly in Forrest. Can anyone 
tell me if this is correct? I have just extended the "simplied-docbook 
plug-in" "sitemap.xmap" that Ross submitted recently.

Am I correct in assuming that the fo created by "fo-cust.xsl" will be 
transformed by the Forrest installation "sitemap.xmap," or must I specify it 
in this plug-in sitemap?

<map:match type="regexp" pattern="^(.*?)([^/]*).pdf$">
        <map:generate src="cocoon:/{1}{2}.fo"/>
        <map:serialize type="fo2pdf"/>
</map:match>

START- PLUG-IN XMAP

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    <!-- Decide on the Docbook Document Type -->
    <map:components>
        <map:actions>
            <map:action
                logger="sitemap.action.sourcetype"
                name="sourcetype"
                src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
                <sourcetype name="docbook-v4.2">
                    <document-declaration public-id="-//OASIS//DTD DocBook XML 
V4.2//EN"/>
                </sourcetype>
                <sourcetype name="docbook-v4.1.2">
                    <document-declaration public-id="-//OASIS//DTD DocBook XML 
V4.1.2//EN"/>
                </sourcetype>
                <sourcetype name="docbook-v4.3">
                    <document-declaration public-id="-//OASIS//DTD DocBook XML 
V4.3//EN"/>
                </sourcetype>
                <sourcetype name="sdocbook-v1.0">
                    <document-declaration public-id="-//OASIS//DTD Simplified 
DocBook XML V1.0//EN"/>
                </sourcetype>
            </map:action>
        </map:actions>
        <map:selectors default="parameter">
            <map:selector
                logger="sitemap.selector.parameter"
                name="parameter"
                src="org.apache.cocoon.selection.ParameterSelector"/>
        </map:selectors>
    </map:components>
    <map:resources>
        <!-- Transform -->
        <map:resource name="transform">
            <map:act type="sourcetype" src="{src}">
                <map:select type="parameter">
                    <map:parameter
                        name="parameter-selector-test"
                        value="{sourcetype}"/>
                    <map:when test="docbook-v4.1.2">
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/xhtml-cust.xsl"/>
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/fo-cust.xsl"/>
                    </map:when>
                    <map:when test="docbook-v4.2">
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/xhtml-cust.xsl"/>
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/fo-cust.xsl"/>
                    </map:when>
                    <map:when test="docbook-v4.3">
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/xhtml-cust.xsl"/>
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/fo-cust.xsl"/>
                    </map:when>
                    <map:when test="sdocbook-v1.0">
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/xhtml-cust.xsl"/>
                        <map:transform
                            src="{forrest:plugins}/docbook/resources/custom/fo-cust.xsl"/>
                    </map:when>
                    <map:otherwise/>
                </map:select>
            </map:act>
        </map:resource>
    </map:resources>
    <!-- Pipe it to Forrest Core -->
    <map:pipelines>
        <map:pipeline internal="true">
            <map:match pattern="**.xml">
                <map:generate src="{project:content.xdocs}{1}.xml"/>
                <map:call resource="transform">
                    <map:parameter
                        name="src"
                        value="{project:content.xdocs}{1}.xml"/>
                </map:call>
                <map:serialize type="xml-document"/>
            </map:match>
        </map:pipeline>
    </map:pipelines>
</map:sitemap>
-- 
Sean Wheller
Technical Author
sean@inwords.co.za
http://www.inwords.co.za

Mime
View raw message