-
Dec 20th, 2007, 01:31 AM
#1
XSLT: Access Request Params
Is it possible to access request parameters in XSLT views without explicitly adding them to the XML Source? I'm pretty sure that global parameters can be defined for XSLT transformations, so it'd be nice to be able to access request attributes so if there's a querystring param such as "...?page=1", I can access it in my XSLT with <xsl:value-of select="$page" /> or <xsl:value-of select="$request.page" />
-
Dec 23rd, 2007, 04:34 AM
#2
This might be a valuable addition but it's probably not the lightest process. You can have a look at Cocoon's XSLTTransformer (method getLogicSheetParameters() which is used in setConsumer()) how we did it there (optionally especially since it also affects caching).
Joerg
-
Dec 23rd, 2007, 07:44 PM
#3
I'm trying to give my application's consumers the option of using XSLT or JSP for the view. I suppose I can simply add a few nodes to the XML Source in my XSLT View representing the querystring/form params. I just didn't want to duplicate functionality that may already exist. XSLT gets a lot of flack for being slower than other other view technologies, but I can't imagine that, if possible, adding request params to the view params would add that much more overhead, other than when you introduce caching, as you mentioned.
-
Dec 23rd, 2007, 08:23 PM
#4
I added a JIRA feature request, even though it's not critical:
http://jira.springframework.org/browse/SPR-4279
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules