forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Gardler" <rgard...@apache.org>
Subject Re: Custom XSL pipeline in sitemap.xmap causes build error
Date Wed, 06 Jun 2007 15:58:26 GMT
On 06/06/07, Steve Odlind <SOdlind@omniture.com> wrote:
>
> I have added a custom DTD, which seems to be working fine. I would like
> all the files with the md-v1.0 DTD declared in the DOCTYPE to use a
> custom XSL.
>
> I have the following in my local sitemap.xmap:
>
>   <map:pipelines>
>     <map:pipeline>
>         <map:match pattern="**.xml">
>           <map:generate src="{properties:content.xdocs}{1}{2}.xml" />

[...]

> When I run Forrest, I get the following:
>
> "linkmap.html  BROKEN: C:\Forrest0_8\apache-forrest-0.8\main\webapp\.
> (Access is denied)"

(I've not reproduced your error, I'm working from what I think is the
problem so tread carefully and come back if my assumptions appear
incorrect)

The problem is that you pattern is way too general. It will match all
requests for an xml document. It is failing on linkmap.xml as this is
the first page processed with a linkmap.xml request.

The issue arises because a pipeline is considered to have been
processed if the generator is fired up. In this case there is no test
to see if the generator in this match should be fired or not.
Therefore it will always fire.

There are two (easy) solutions to your problem:

a) use a narrower match that will only work when you know the custom
DTD is to be used
b) don't worry about the match, just redefine the sourcetype action
that does the processing

Advantages of a) are that it is faster and easier to maintain. The
disadvantage is that you have to have all your custom DTD documents in
a single path and this may not be possible. You could use a regular
expression in the match to get around this problem, but you are still
limited.

Advantages of b) are that it will work with any file in any location.
Disadvantages include it is less efficient as the file type needs to
be tested before it is processed and it is harder to maintain when you
upgrade Forrest.

If you go for a) then simply change your match to something like:

<map:match pattern="myCustomDocs/**.xml">

If you go for b) then copy the following elements from forrest.xmap
and add your custom DTD and transformation to them:

<map:action logger="sitemap.action.sourcetype" name="sourcetype"
src="org.apache.forrest.sourcetype.SourceTypeAction">

...

<map:resource name="transform-to-document">

Interestingly, your question gives me an idea of how we can make this
easier in the next version of Forrest. But I'll take that to the dev
list when I get time.

Ross

Mime
View raw message