cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: [C2]determine stylesheet in XSP
Date Tue, 24 Apr 2001 17:13:49 GMT
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message