You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Homeijer <M....@devote.nl> on 2001/04/23 13:33:59 UTC

[C2]determine stylesheet in XSP

Hi,

Based on the logic in the XSP stylesheet (actually the amount of data
retrieved in a query), I need to change the stylesheet that was specified
for my request in the sitemap.
In C1, I could use <xsp:pi target="xml-stylesheet"> to get this working, is
there an alternative in C2?

TIA,
Michael

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

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


Re: [C2]determine stylesheet in XSP

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 24 Apr 2001, Sylvain Wallez wrote:

> > > > Based on the logic in the XSP stylesheet (actually the amount of data
> > > > retrieved in a query), I need to change the stylesheet that was specified
> > > > for my request in the sitemap.
> > > > In C1, I could use <xsp:pi target="xml-stylesheet"> to get this working, is
> > > > there an alternative in C2?
> > >
> > > It's done in the sitemap.  You have the concept of Matchers, Selectors, and
> > > Actions which can all change the way the pipeline is built.  If you change
> > > the stylesheet based on the type of browser, you can use the Browser Selector
> > > to pick the stylesheet.  If you wan't to match on URI, you can nest matchers.
> > > If you want your selection to be based on complex representations of information
> > > such as a database query, then Actions are your answer.
> >
> > then we need to come up with a better way of writing actions. or hey, why
> > can't xsp pages have the option of passing a Map back to the sitemap for
> > doing stuff like this?
> >
> > - donald
> >
> The problem with XSP in C2 is that their role as a generator is limited
> to producing content. If you consider ESQL (I know youd Donald know it
> well ;-) ), the logicsheet both processes request parameters (and should
> be a C2 action) and produces content (and should be a C2 generator).
>
> Taking further your idea of XSPs passing a Map back to the sitemap, it
> could be a XSPAction whose XML result is also returned as an entry in
> the Map containing serialized SAX events. After XSP execution, control
> is returned back to the sitemap flow (content generation from the
> XSPAction result, redirect to another URL, etc).
>
> What do you think about that ?

i think we should be able to write xsp components that act as actions. my
xsp action might look like this:

<xsp:action>
 <map>
  ...
  <esql:row-results>
   <foo><esql:get-string column="1"/></foo>
  </esql:row-results>
  ...
 </map>
</xsp:action>

and the map it returns would have a key named 'foo' with a value of the
the value of the first column. we could either mandate that the tree be
flat or extend the {} expression syntax a bit to allow stuff like this:

{foo/bar/bat}

to keep things simple, we could mandate that no two element siblings have
the same name.

- donald


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

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


Re: [C2]determine stylesheet in XSP

Posted by Sylvain Wallez <sy...@anyware-tech.com>.

Donald Ball a écrit :
> 
> On Mon, 23 Apr 2001, Berin Loritsch wrote:
> 
> > > Based on the logic in the XSP stylesheet (actually the amount of data
> > > retrieved in a query), I need to change the stylesheet that was specified
> > > for my request in the sitemap.
> > > In C1, I could use <xsp:pi target="xml-stylesheet"> to get this working, is
> > > there an alternative in C2?
> >
> > It's done in the sitemap.  You have the concept of Matchers, Selectors, and
> > Actions which can all change the way the pipeline is built.  If you change
> > the stylesheet based on the type of browser, you can use the Browser Selector
> > to pick the stylesheet.  If you wan't to match on URI, you can nest matchers.
> > If you want your selection to be based on complex representations of information
> > such as a database query, then Actions are your answer.
> 
> then we need to come up with a better way of writing actions. or hey, why
> can't xsp pages have the option of passing a Map back to the sitemap for
> doing stuff like this?
> 
> - donald
> 
The problem with XSP in C2 is that their role as a generator is limited
to producing content. If you consider ESQL (I know youd Donald know it
well ;-) ), the logicsheet both processes request parameters (and should
be a C2 action) and produces content (and should be a C2 generator).

Taking further your idea of XSPs passing a Map back to the sitemap, it
could be a XSPAction whose XML result is also returned as an entry in
the Map containing serialized SAX events. After XSP execution, control
is returned back to the sitemap flow (content generation from the
XSPAction result, redirect to another URL, etc).
 
What do you think about that ?
-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

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

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


Re: [C2]determine stylesheet in XSP

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 23 Apr 2001, Berin Loritsch wrote:

> > Based on the logic in the XSP stylesheet (actually the amount of data
> > retrieved in a query), I need to change the stylesheet that was specified
> > for my request in the sitemap.
> > In C1, I could use <xsp:pi target="xml-stylesheet"> to get this working, is
> > there an alternative in C2?
>
> It's done in the sitemap.  You have the concept of Matchers, Selectors, and
> Actions which can all change the way the pipeline is built.  If you change
> the stylesheet based on the type of browser, you can use the Browser Selector
> to pick the stylesheet.  If you wan't to match on URI, you can nest matchers.
> If you want your selection to be based on complex representations of information
> such as a database query, then Actions are your answer.

then we need to come up with a better way of writing actions. or hey, why
can't xsp pages have the option of passing a Map back to the sitemap for
doing stuff like this?

- donald


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

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


Re: [C2]determine stylesheet in XSP

Posted by Berin Loritsch <bl...@apache.org>.
Michael Homeijer wrote:
> 
> Hi,
> 
> Based on the logic in the XSP stylesheet (actually the amount of data
> retrieved in a query), I need to change the stylesheet that was specified
> for my request in the sitemap.
> In C1, I could use <xsp:pi target="xml-stylesheet"> to get this working, is
> there an alternative in C2?

It's done in the sitemap.  You have the concept of Matchers, Selectors, and
Actions which can all change the way the pipeline is built.  If you change
the stylesheet based on the type of browser, you can use the Browser Selector
to pick the stylesheet.  If you wan't to match on URI, you can nest matchers.
If you want your selection to be based on complex representations of information
such as a database query, then Actions are your answer.

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

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