forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Own type of documen transformed to document-v20
Date Sun, 14 May 2006 12:24:00 GMT
Cameron McCormack wrote:
> Gav:
> 
>>Ok, will take another look, but initially I assumed you wanted to use 
>>DTDs as you declared them in your code, this is why it is failing as 
>>It can not find the specified DTD.
> 
> 
> Right, OK.  I just declared them because, from looking at the sample
> sitemap.xmap file, I gathered that was the way you had to do it.

The sourcetype resolver can only work if you define the type of 
document. To do this you have to use DTD's.

You could work without DTD's but you would have to place your home grown 
files in a specific directory so that you can match on location rather 
than type.

If you did this you would have to turn validation off (see 
forrest.properties)

see below for more...

> OK, forget I mentioned DTDs. :-)
> 
> There must be some way I can tell Cocoon/Forrest, via the sitemap.xmap
> file, that when a file called status.xml is requested, it should be
> passed transformed with a particular XSLT file into a document-v20
> document, and from there, converted into either HTML or PDF, as would
> normally be done.  Cocoon is quite complicated, though, and I haven't
> yet got my head around it.  (Nor do I quite understand the relationship
> between Forrest and Cocoon...)

(you don't mention which version of Forrest you are working with, the 
below is 0.7, in 0.8-dev this will still work but you should realy use 
the locationmap to resolve source locations).

<map:match pattern ="path/to/my/files/**.xml">
   <map:generate src="{project:content.xdocs}/path/to/my/sources/{{1}.xml"/>
   <map:transform src="myFormat-to-document.xsl"/>
   <map:serialize type="xml"/>
</map:match>

Gavin points to some examples in forrest, but these all use the 
sourceresolver, and requrie a DTD.

I really would recomend using a DTD it makes things much more flexible 
and will prevent time hunting errors in your source files. But the 
choice is yorus.

Ross

Mime
View raw message