Kevin wrote:
Thorsten Scherler wrote:
Hi Kevin,
http://svn.apache.org/viewcvs?view=rev&rev=159868
Rick commited some code to make forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl more generic.
Thank you for your help. I'll look at how project2text.xsl is called so I understand things correctly. I appreciate your ideas below and will use the new svn version.
Kevin.
If you make an svn up your problem may be already solved. ;-)
Changing the stopping color may be easier to change directly in the *.svg code.
...
I have looked at project2text.xsl and if I understand right it outputs the values of document (skinconf.xml) children not all descendants?
It does work on all descendants because of the copyover import at the head of the file.
The control for all generation is in our *.xmap file in FORREST_HOME/main/webapp.Also I am confused to how project2text.xsl works. I understand the xml file is group.svg and transformed with project2text.xsl replacing <for:element /> in the svg somehow with elements from another xml ie. skinconf.xml possibly after it's own transform with skin and common skinconf.xsl files. It's this:
<xsl:variable name="config" select="//skinconfig"/>
how does it hook into the <skinconf> tree. "//skinconfig" means all "skinconfig" descendants of the document element? I'm wrong in my understanding :
If you search the xmap files for occurrences of project2text.xsl you will see a series of matches in resources.xmap. As you get used to how forrest works you will learn where these files are used. The resources.xmap file is used to process requests for resources such as graphics, scripts and CSS.
Anyway, looking at where project2text.xsl is used in resources.xmap you see a few of pipelines like this:
<map:resource name="pipe-aggregate-svg2png-resource">
<map:call resource="generate-aggregate-resource">
<map:parameter name="path" value="{path}" />
</map:call>
<map:call resource="transform-project2text"/>
<map:transform src="{forrest:stylesheets}/extract-svg.xsl"/>
<map:serialize type="svg2png" />
</map:resource>The two resources in this pipleline are:
<map:resource name="generate-aggregate-resource">
<map:aggregate element="resource">
<map:part src="cocoon://skinconf.xml" />
<map:part src="{path}"/>
</map:aggregate>
</map:resource>and:
<map:resource name="transform-project2text">
<map:transform src="{forrest:stylesheets}/project2text.xsl"/>
</map:resource>So we can now see that the above pipeline does the following:
- aggregate skinconf.xml and another document indicated by the path variable.
- transform it using project2text.xsl
- serialise it using the svg2png serialiser
(if you don't understand how this works you need to learn about Cocoon xmap files there are some links to documentation at http://forrest.apache.org/docs/your-project.html#sitemap.xmap )
So, to get answer your question of "how does <xsl:variable name="config" select="//skinconfig"/> it into the <skinconf> tree. " You were right that "//skinconfig" means all skinconfig elements in the document, but I suspect you did not realise that skinconf.xml is aggregate with the document you are processing before the stylesheet gets to work.
Ross
