You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@hotmail.com> on 2003/11/04 08:21:13 UTC
Two-pass transformation tutorial needed
Hi,
I' looking for a two-pass transformation tutorial for cocoon.
Why?
My post on xsl-list:
___________________________________________________________________________
My problem is that I have lots of different stylesheets for the
main-template (<xsl:call-template name="main"/>), and I don't want to write
millions of different xsl's that differ just in one entry (<xsl:include
href="XXXXX"/>).
Is there an other way to solve this problem?
my xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="main"><xsl:value-of
select="/document/style"/></xsl:variable>
<xsl:template match="/document">
...
<xsl:call-template name="main"/>
...
</xsl:template>
<!-- wrong usage of include -->
<xsl:include href="{$main}"/>
<!-- end wrong usage -->
<!-- needed to "code" around it -->
</xsl:stylesheet>
______________________________________________________________________
They told me to use two pass transformation. Are there some documented
examples for this in cocoon?
Regards
Jonny
_________________________________________________________________
FreeSMS abräumen mit dem MSN Messenger - der Countdown läuft!
http://messenger-mania.msn.de Jetzt mitmachen und gewinnen!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Two-pass transformation tutorial needed
Posted by Joerg Heinicke <jh...@virbus.de>.
It's a sitemap thing:
<map:match pattern="**">
<map:generate src="doc.xml"/>
<map:transform src="step1.xsl"/>
<map:transform src="step2.xsl"/>
<map:serialize/>
</map:match>
If you now do in step1 the output independent transformations and in
step2 the dependent ones (the main template), you should have less
stylesheets than before.
Joerg
On 04.11.2003 08:21, Johannes Becker wrote:
> Hi,
>
> I' looking for a two-pass transformation tutorial for cocoon.
> Why?
>
> My post on xsl-list:
> ___________________________________________________________________________
>
> My problem is that I have lots of different stylesheets for the
> main-template (<xsl:call-template name="main"/>), and I don't want to
> write millions of different xsl's that differ just in one entry
> (<xsl:include href="XXXXX"/>).
> Is there an other way to solve this problem?
>
> my xsl:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:variable name="main"><xsl:value-of
> select="/document/style"/></xsl:variable>
> <xsl:template match="/document">
> ...
> <xsl:call-template name="main"/>
> ...
> </xsl:template>
> <!-- wrong usage of include -->
> <xsl:include href="{$main}"/>
> <!-- end wrong usage -->
> <!-- needed to "code" around it -->
> </xsl:stylesheet>
> ______________________________________________________________________
>
> They told me to use two pass transformation. Are there some documented
> examples for this in cocoon?
>
> Regards
> Jonny
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org