When I use the docbook pipeline Brian suggested everything looks great
except that I get two titles on the top of the page. Is there anyway to
get rid of one of them?
For example if my file looks like:
<article ...>
<title>Using the Java Messaging System</title>
...
</article>
The HTML output has the title twice.
> -----Original Message-----
> From: Brian M Dube [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 16, 2006 1:21 AM
> To: [email protected]
> Subject: Re: Using Docbook
>
> Johnson, Eric wrote:
> > I'm trying to use docbook files as part of the source to Forrest
(v7.0).
> > I want to be able to use docbook and document v2.0. I've tried to
get a
> > match and transform working, but to date all I can get is an empty
html
> > file as output.
> >
> > Here is the match from my projects sitemap.xml:
> >
> > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> >
> > <map:components>
> > <map:actions>
> > <map:action logger="sitemap.action.sourcetype"
name="sourcetype"
> > src="org.apache.forrest.sourcetype.SourceTypeAction">
> > <sourcetype name="docbook-v4.1.2">
> > <document-declaration public-id="-//OASIS//DTD DocBook
> > XML V4.1.2//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>
> > </map:resources>
> >
> > <map:pipelines>
> > <map:pipeline>
> > <map:match pattern="old_site/*.html">
> > <map:select type="exists">
> > <map:when test="{project:content}{1}.html">
> > <map:read src="{project:content}{1}.html"
> > mime-type="text/html"/>
> > <!--
> > Use this instead if you want JTidy to clean up your HTML
> > <map:generate type="html" src="{project:content}/{0}" />
> > <map:serialize type="html"/>
> > -->
> > </map:when>
> > </map:select>
> > </map:match>
> >
> > <map:match pattern="**.xml">
> > <map:act type="sourcetype"
src="{project:content.xdocs}{1}.xml">
> > <map:select type="parameter">
> > <map:parameter name="parameter-selector-test"
value="{sourcetype}"
> > />
> > <map:when test="docbook-v4.1.2">
> > <map:generate src="{project:content.xdocs}{1}.xml" />
> > <map:transform
> >
src="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
> > " />
> > </map:when>
> > </map:select>
> > </map:act>
> > </map:match>
> > </map:pipeline>
> > </map:pipelines>
> > </map:sitemap>
>
> The following worked for me, although I tested it with v0.8-dev. The
> stylesheet naming convention has changed since v0.7 and I included the
> backwards change in the pasted copy below, but I did not test this
with
> v0.7.
>
> You may also want to use local copies of the DocBook stylesheets as
well.
>
>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>
> <map:components>
> <map:actions>
> <map:action logger="sitemap.action.sourcetype"
name="sourcetype"
> src="org.apache.forrest.sourcetype.SourceTypeAction">
> <sourcetype name="docbook-v4.1.2">
> <document-declaration public-id="-//OASIS//DTD DocBook XML
> V4.1.2//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>
> </map:resources>
>
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="old_site/*.html">
> <map:select type="exists">
>
> <map:when test="{project:content}{1}.html">
> <map:read src="{project:content}{1}.html"
mime-type="text/html"/>
> <!--
> Use this instead if you want JTidy to clean up your HTML
> <map:generate type="html" src="{project:content}/{0}" />
> <map:serialize type="html"/>
> -->
> </map:when>
> </map:select>
> </map:match>
>
> <map:match pattern="**.xml">
> <map:generate src="{project:content.xdocs}{1}.xml" />
>
> <map:act type="sourcetype"
src="{project:content.xdocs}{1}.xml">
> <map:select type="parameter">
> <map:parameter name="parameter-selector-test"
> value="{sourcetype}" />
> <map:when test="docbook-v4.1.2">
> <map:transform
>
src="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
"
> />
> <map:transform
src="{forrest:stylesheets}/html2document.xsl" />
> <map:transform type="idgen" />
> <map:serialize type="xml-document" />
> </map:when>
> </map:select>
> </map:act>
> </map:match>
>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>