cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Pope" <ben_p...@hotmail.com>
Subject Re: Request Parameters in XSLT (Cocoon 2.1.5)
Date Mon, 19 Jul 2004 09:44:30 GMT
Thanks for your reply.

I'll sift through it later.

Cheers,
Ben.



----- Original Message ----- 
From: "Derek Hohls" <DHohls@csir.co.za>
To: <users@cocoon.apache.org>
Sent: Monday, July 19, 2004 8:15 AM
Subject: RE: Request Parameters in XSLT (Cocoon 2.1.5)


> Ben
> 
> Have a look at the recent xsl mailing list archives... I have 
> been having *exactly* the same problems (choosing a 
> sort selection dynamically) and there were a number of 
> very helpful answers from the folks there!
> 
> http://www.mulberrytech.com/xsl/xsl-list
> 
> Derek
> 
> PS and yes, <xsl:param> must *always* come before
> your template matches - suggest you find some some
> good reading material on XSL and get to grips with the
> basics... I reccommend Michael Kay's XSLT Programmer's
> Reference.
> 
>>>> nospam@hotmail.com 2004/07/19 02:43:53 AM >>>
> Hi Adam,
> 
> Thanks for the reply.
> 
> I changed the sitemap (That looks pretty close to another variation I
> tried).
> 
> My output.xsl Already had
> <xsl:param name="sort"/>
> 
> But it still didn't work.
> 
> Then I reordered some stuff to what you suggested (don't know if you
> meant
> for me to re-order it)
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <xsl:param name="sort"/>
> 
> Became
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:param name="sort"/>
> <xsl:template match="/">
> 
> And it now says:
> "Reports - sort order = date."
> Or
> "Reports - sort order = number."
> 
> So <xsl:value-of select="$sort"/> works nicely.
> 
> You star!
> 
> So is it best to have use-request-parameters set to false and pass the
> single parameter in (in terms of ability to cache the form)?  I guess
> it can
> use the cached version if that one parameter remains constant, rather
> then
> the whole set of parameters?
> 
> One problem persists:
> 
> It still doesn't actually sort the table.
> 
> <xsl:for-each select="data/reports/*">
> <xsl:sort select="$sort"/>
> <!-- blah -->
> </xsl:for-each>
> 
> 
> Is my <xsl:sort /> tag correct?  (I presume not).
> 
> Thank you again, I am at least a lot closer.
> 
> Ben.
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Adam Walsh [mailto:awalsh@contal.net.au] 
> Sent: 19 July 2004 00:48
> To: users@cocoon.apache.org 
> Subject: Re: Request Parameters in XSLT (Cocoon 2.1.5)
> 
> Hi Ben,
> 
> I'd suggest the following:
> 
> Sitemap.xmap:
> 
> <map:match pattern="output">
> <map:generate src="input.xml" type="file"/>
> <map:transform src="output.xsl" type="xslt">
> <map:parameter name="sort" value="{request-param:sort}"
> />
> </map:transform>
> <map:serialize/>
> </map:match>
> 
> 
> and make sure in your output.xsl you have <xsl:param name="sort"/>,
> ie:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> <xsl:param name="sort"/>
> 
> <xsl:template match="/">
> ...
> </xsl:template>
> </xsl:stylesheet>
> 
> 
> Hope that helps.
> 
> Adam
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
> For additional commands, e-mail: users-help@cocoon.apache.org 
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> MailScanner thanks transtec Computers for their support.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message