Maurice Lanselle wrote:
Ross Gardler said the following on 06/06/2005 16:15:

Maurice Lanselle wrote:

I am trying to integrate another content type, one based on a published document schema from a standards association (hr-xml.org).



It would be better to do this as a plugin as it would be useful to a wider community. Are you using 0.7? If not you cannot build it as a plugin. I would recomend changing to 0.7 (it is stable enough being very close to a release).

Building a plugin is really easy, see http://forrest.apache.org/0.7/docs/howto/howto-buildPlugin.html

I've just now read the docs on plugins you pointed to, and I understand why you recommend that route. For various personal reasons, I'm waiting for 0.7 distribution, and am not in a position to build from sources myself. But it seems like my resume2document.xsl stylesheet could be reused in an input plugin later without making changes, just packaging it. Is that not true?

Yes.

...

However, you should avoid limiting the URL space of your application by requiring a given file type to have a given filename or path. This can result in false matches. You should use the SourceTypeResolver, for an example of how see http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.input.simplified-docbook/input.xmap?view=markup for an example of how to do this.


I totally buy your point about not requiring a document type to have a given file name or path. Since I'm trying to use or produce xml files which have the ".xml" extension rather than something more distinctive, I would like Forrest to choose the stylesheet on the basis of the doctype, perhaps using a catalog (like for resolving DTDs...why not catalogs for xsl?). It looks like that is what happens in the <map:resources> group in the example you pointed me to (below). My first attempt to *bend* it to my purpose failed, however: "Type 'sourcetype' does not exist for 'map:pipeline' at..." when I replaced

You need to copy the section that defines the sourcetype component too (see <map:components>) in the above linked sitemap.

Ross