You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2005/07/28 00:50:59 UTC

Debugging transformations in Forrest (was Re: problem)

HANAX wrote:
> My sitemap seems ok:
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>   <map:pipelines>
>     <map:pipeline>
>       <!-- Voice -->
>       <map:match type="regexp" pattern="^(.*?)([^/]*).mxml$">
>         <map:generate src="cocoon://{1}{2}.xml"/>
>         <map:transform src="resources/stylesheets/document2mxml.xsl"/>
>         <map:serialize type="xml"/>
>       </map:match>
>     </map:pipeline>
>   </map:pipelines>
> </map:sitemap>
> 
> line from forrest.properties for loading plugin seems ok too
> project.required.plugins=org.apache.forrest.plugin.output.pdf,org.apache.forrest.plugin.output.voice
> 
> And I got this one:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>   
>     Section 
>     
>       Section 
>       One.
>     
>       Section 
>       
>         This demo site has many examples. See the menu at the left.
>         The sources for these examples are in the directory
>         here
>       
>       
>         The sources for the Apache Forrest website are also included
>         in your distribution at $FORREST_HOME/site-author/
>       
>       You can also extend the functionality of Forrest via
>       plugins,
>       these will often come with more samples for you to out.
>     
>       Section 
>       
>         Hello.
>       
> 
> This I mean as plaintext.

This looks like there is something in the XSL copying the contents of 
all elements into your output document, but not processing it.

> But it's weird that when I change anything in my .xsl file it does nothing... no change... it seems that my stylesheet is not used at all... :(

First we need to verify that you request is actually being processed by 
your plugin. A quick and easy way to do this is to force an error:

cd PLUGIN_DIR
forrest run

then in another console:

cd PLUGIN_DIR
edit the sitemap so that the line:

<map:transform src="resources/stylesheets/document2mxml.xsl"/>

says:

<map:transform src="resources/stylesheets/document2mxml.xsl-error"/>

(note the addition of "-error" to the src)

"ant local-deploy"

Now request the page, if it is being processed by your plugin you should 
see an error saying that the XSL cannot be found (as expected). If you 
recieve this error then you know that Forrest is trying to process the 
file using your plugin XSL.

I suspect that you will find it is being processed, the above is only to 
verify this is the case since you say you think it may not be being used.

Assuming that it is being used you can then comment out the 
transofrmation line, do "ant local-deploy" and request the page again. 
You should now recieve the document in its raw format.

Assuming that this all goes to plan we now know you have a problem in 
your XSL file.

> The second thing

Addressed in anothe reply (please keep mails to one topic and make the 
subject lines meaningful so that the mail archives can be easily searched).

Ross