forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <>
Subject Re: Using locationmap in sitemap.xmap
Date Tue, 23 Sep 2008 22:34:51 GMT
Pablo Barrera wrote:
> Hello
> I am trying to read several files from a directory to extract some 
> information from each one and create a resume. I am being looking at 
> org.apache.forrest.plugin.input.Resume. I have my sitemap working but I 
> use this line (a copy from a similar line in the plugin code):
> <map:transform 
> src="{properties:resources}/stylesheets/alldocs-to-revisions.xsl" />
> I tried to use locationmap to look for the xsl code, so I changed the 
> line to
> <map:transform src="{lm:transformation.alldocs.revisions}" />
> and then to
> <map:transform src="{lm:alldocs-to-revisions.xsl}" />
> as commented in [1], but it's not working. My locationmap looks at 
> /PATH-TO-MY-SITE/src/documentation/skins/pelt/xslt/html/alldocs-to-revisions.xsl 
> Why is it looking to pelt/xslt/html? Any idea?

The locationmap looks in a number of places for your required file, if 
it doesn't find it in the first location it falls back to the next 
possible location. I'm pretty sure the above location is only *one* 
location that the system is looking since it comes from the first 
location in the following match from the locationmap-transform.xml file [2]:

<!-- All core other transforms -->
     <match pattern="transform.*.*">
         <location src="{forrest:forrest.stylesheets}/{1}-to-{2}.xsl"/>

Since you say that it was working with

src="{properties:resources}/stylesheets/alldocs-to-revisions.xsl" />

That tells me that your stylesheet is in


There are two solutions to this. The first is to copy the above match to 
your project locationmap and add (as the first location):

<location          src="{properties:resources}/stylesheets/{1}-to-{2}.xsl/>

This will work for all stylesheets located in your project directory.

The second solution seems more appropriate to me. It is likely that 
content objects will provide their own stylesheets on occasion (as you 
are doing) and therefore this match should be added to the default 
locationmap [1]. Please try this latter solution and, if it works, send 
us a patch.


Since I know what you are doing here (remember folks, Pablo is currently 
working in my team) let me go a step further...

Pablo is aggregating the content of a directory with TEI documents in 
order to create sorted lists of documents based on their revision headers.

I'd suggest that this functionality actually belongs in the TEI plugin 
not in the content object. That way it can be reused by other folk 
working with TEI in this way.

To do this you need a plugin specific location, as an example see [3] 
where you will find:

     <match pattern="pdf.transform.*.*">
         <location src="resources/stylesheets/{1}-to-{2}.xsl"/>

coupled with xmap [4] such as of:

<map:transform src="{}">


> [1]

View raw message