cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Spoerri <j...@basit.com>
Subject xsl params deficient !
Date Fri, 18 Aug 2000 06:13:29 GMT
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.

it's evil: mixing of content and presentation.

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>


Mime
View raw message