cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: xsl params deficient !
Date Fri, 18 Aug 2000 18:44:54 GMT
Joshua Spoerri <josh@basit.com> wrote:
>the following demonstrates that xsl params are deficient for properly
>representing query strings...
>
>i am writing an xsl gadget to page through a large number of xml records.
>
>this seems like a perfect candidate for xsl, a completely presentation 
>layer
>translation.
>
>so i make a <xsl:param>s for the "number of records per page" and "number 
>of
>the current page", and have the xsl create links to advance and reduce the
>number of the current page, and append it to the query string.
>
>but this means that the xsl needs to know the locaton of the xml that
>it is transforming (along with _its_ querystring). no big deal, just supply
>that as an element in the xml, e.g. <xmlurl>myData.xml?a=b&c=d</xmlurl>.
>
>now here's the catch: we just appended the page number to the query string,
>so that for the resultant page, the xml will pass it back to the xsl
>in the query string: <xmlurl>myData.xml?a=b&c=d&pageN=2</xmlurl>.
>in order to prevent the xsl from appending a new pageN parameter to
>each succeeding page, the xml generator has to strip the pageN from
>the url that passes.
>
>so now we're stuck with either the xsl knowing about all of parameters
>of the xml (so that _it_ can build the "next page" link), or else the
>xml knowing about this pageN parameter so that it can strip it out.

I would recommend the latter. The job is better suited for XSP, especially 
if the page can be requested either through GET or POST, which complicates 
the issue somewhat - and it works for us.

>
>it's evil: mixing of content and presentation.

I wouldn't say that. An URL is not really part of the presentation - it is 
not directly displayed to the user. And this (avoiding duplicate parameters) 
is not the kind of thing that a non-programmer web designer would want to 
get their hands dirty with, I don't think. It's a logic issue, really.

>
>why not standardize a little subtree to represent the query string
>(or even post query):
><htmlquery>
><get>
><a>b</a>
><c>d</c>
><pageN>2</pageN>
><even><multi>valued</multi><multi>fields!</multi></even>
></get>
><post>
>...
></post>
></htmlquery>

Indeed - this is the sort of thing that a generalised FP-type taglib would 
be good for.


--
Robin Green
i-tao Ltd.
4 Skyline Village
Limeharbour
London E14 9TS
United Kingdom
Phone +44 20 7537 2233  Fax +44 70 8081 5118
http://www.i-tao.com


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message