You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Sösemann <ro...@gmx.de> on 2002/11/25 22:15:43 UTC

Concat dynamically assigned xslt

I am not sure if this is a cocoon specific problem or solveable with XSL
only. I have this problem.

I am working on a CMS where non-programmers can feed articles to a db.
Cocoon output those articles in different ways. The problematic view is the
multi-article page. There abstracts of many different article types are
displayed. As I want the system to be extensible - that means without one
big pre-.made xslt - the user can write there own stylesheet for EVERY
article. All they should have to do is save the xsl and write its path to
the db.

As I have this multi-article view I would need to dynmically merge all
assigned xslt to one sytlesheet that could be a cocoon transformer in my
pipeline:

SITEMAP
....
<map:match pattern="abstractpage_*.html">
    <map:generate src="getEverythingFromDBAsXML.xsp"/>
    ...? MAGIC COMPONENT ?
    <map:transform src="dynamicallyGenerated.xsl"/>
<map:serialize type="html"/>
</map:match>
....

GENERATOR:
...
<PAGE>
    <ABSTRACT nr="1" styleMeWith="first.xsl">
    ...
    </ABSTRACT>
...
    <ABSTRACT nr="5 styleMeWith="fifth.xsl
    ...
    </ABSTRACT>
..
</PAGE>

Can you imagine a solution to this problem. Maybe with meta-stylesheets?

Thanks in advance!

Rob





---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Concat dynamically assigned xslt

Posted by Robert Sösemann <ro...@gmx.de>.
This sound good to me, but I never used aggregation nor xinclude. I even
don't know the differnece.

But as I understand the XSP xsp should  get the meta info from the db, the
line <map:transform src="transformers/convertMetaInfo2XInclude.xsl"/>
transforms this into xinclude tags that hold the path information for every
abstract that later resides on one page.
Another transformer just build ONE abstract with its dynamically assigned
stylesheet path.
Later everything is combined by content aggregation.

Can I controll the way the abstracts are combined or is it just html
concatenation? Or is this controlled by the last transformer <map:transform
src="stylesheets/maybeSomePostProcessing.xsl"/>?

Do you know good examples on aggregation an xinclude?

Thanks for your help:

Rob

----- Original Message -----
From: "Joerg Heinicke" <jo...@gmx.de>
To: <co...@xml.apache.org>
Cc: <xs...@lists.mulberrytech.com>
Sent: Monday, November 25, 2002 10:45 PM
Subject: Re: Concat dynamically assigned xslt


> I would not create a huge, dynamically created XSLT. Cocoon offers you
> aggregation or CInclude/XInclude. So I would transform the output of the
> transformer for example to the following:
>
> <PAGE>
>    <xi:include href="cocoon:/abstract1-first"/>
>    ...
>    <xi:include href="cocoon:/abstract5-fifth"/>
> </PAGE>
>
> The generator would then give only the information how to get the
> content of the abstract and the name of the xsl. The sitemap would match
> on this:
>
> <map:match pattern="abstract*-*">
>    <map:generate src="content-abstract{1}"/>
>    <map:transform src="stylesheets/{2}.xsl"/>
>    <map:serialize type="xml"/>
> </map:match>
>
> So every abstract is transformed separately and aggregated at the end to
> a "big thing".
>
> Your original abstract pipeline I would change to:
>
> <map:match pattern="abstractpage_*.html">
>    <map:generate src="getEveryMetaInfoFromDBAsXML.xsp"/>
>    <map:transform src="transformers/convertMetaInfo2XInclude.xsl"/>
>    <map:transform type="xinclude"/>
>    <map:transform src="stylesheets/maybeSomePostProcessing.xsl"/>
>    <map:serialize type="html"/>
> </map:match>
>
> So the whole processing is not a XSLT problem, but a solvable Cocoon
> problem. Is the propagated way an option? Or is your way already fixed?
>
> Regards,
>
> Joerg
>
> Robert Sösemann wrote:
> > I am not sure if this is a cocoon specific problem or solveable with XSL
> > only. I have this problem.
> >
> > I am working on a CMS where non-programmers can feed articles to a db.
> > Cocoon output those articles in different ways. The problematic view is
the
> > multi-article page. There abstracts of many different article types are
> > displayed. As I want the system to be extensible - that means without
one
> > big pre-.made xslt - the user can write there own stylesheet for EVERY
> > article. All they should have to do is save the xsl and write its path
to
> > the db.
> >
> > As I have this multi-article view I would need to dynmically merge all
> > assigned xslt to one sytlesheet that could be a cocoon transformer in my
> > pipeline:
> >
> > SITEMAP
> > ....
> > <map:match pattern="abstractpage_*.html">
> >     <map:generate src="getEverythingFromDBAsXML.xsp"/>
> >     ...? MAGIC COMPONENT ?
> >     <map:transform src="dynamicallyGenerated.xsl"/>
> > <map:serialize type="html"/>
> > </map:match>
> > ....
> >
> > GENERATOR:
> > ...
> > <PAGE>
> >     <ABSTRACT nr="1" styleMeWith="first.xsl">
> >     ...
> >     </ABSTRACT>
> > ...
> >     <ABSTRACT nr="5 styleMeWith="fifth.xsl
> >     ...
> >     </ABSTRACT>
> > ..
> > </PAGE>
> >
> > Can you imagine a solution to this problem. Maybe with meta-stylesheets?
> >
> > Thanks in advance!
> >
> > Rob
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Concat dynamically assigned xslt

Posted by Joerg Heinicke <jo...@gmx.de>.
I would not create a huge, dynamically created XSLT. Cocoon offers you 
aggregation or CInclude/XInclude. So I would transform the output of the 
transformer for example to the following:

<PAGE>
   <xi:include href="cocoon:/abstract1-first"/>
   ...
   <xi:include href="cocoon:/abstract5-fifth"/>
</PAGE>

The generator would then give only the information how to get the 
content of the abstract and the name of the xsl. The sitemap would match 
on this:

<map:match pattern="abstract*-*">
   <map:generate src="content-abstract{1}"/>
   <map:transform src="stylesheets/{2}.xsl"/>
   <map:serialize type="xml"/>
</map:match>

So every abstract is transformed separately and aggregated at the end to 
a "big thing".

Your original abstract pipeline I would change to:

<map:match pattern="abstractpage_*.html">
   <map:generate src="getEveryMetaInfoFromDBAsXML.xsp"/>
   <map:transform src="transformers/convertMetaInfo2XInclude.xsl"/>
   <map:transform type="xinclude"/>
   <map:transform src="stylesheets/maybeSomePostProcessing.xsl"/>
   <map:serialize type="html"/>
</map:match>

So the whole processing is not a XSLT problem, but a solvable Cocoon 
problem. Is the propagated way an option? Or is your way already fixed?

Regards,

Joerg

Robert Sösemann wrote:
> I am not sure if this is a cocoon specific problem or solveable with XSL
> only. I have this problem.
> 
> I am working on a CMS where non-programmers can feed articles to a db.
> Cocoon output those articles in different ways. The problematic view is the
> multi-article page. There abstracts of many different article types are
> displayed. As I want the system to be extensible - that means without one
> big pre-.made xslt - the user can write there own stylesheet for EVERY
> article. All they should have to do is save the xsl and write its path to
> the db.
> 
> As I have this multi-article view I would need to dynmically merge all
> assigned xslt to one sytlesheet that could be a cocoon transformer in my
> pipeline:
> 
> SITEMAP
> ....
> <map:match pattern="abstractpage_*.html">
>     <map:generate src="getEverythingFromDBAsXML.xsp"/>
>     ...? MAGIC COMPONENT ?
>     <map:transform src="dynamicallyGenerated.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> ....
> 
> GENERATOR:
> ...
> <PAGE>
>     <ABSTRACT nr="1" styleMeWith="first.xsl">
>     ...
>     </ABSTRACT>
> ...
>     <ABSTRACT nr="5 styleMeWith="fifth.xsl
>     ...
>     </ABSTRACT>
> ..
> </PAGE>
> 
> Can you imagine a solution to this problem. Maybe with meta-stylesheets?
> 
> Thanks in advance!
> 
> Rob


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>