Results 1 to 4 of 4

Thread: XSLT: Access Request Params

  1. #1
    Join Date
    Jul 2006
    Posts
    138

    Default 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" />

  2. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    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
    This post can contain insufficient information.

  3. #3
    Join Date
    Jul 2006
    Posts
    138

    Default

    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.

  4. #4
    Join Date
    Jul 2006
    Posts
    138

    Default

    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
  •