Login 
 
 Pref   Your subscriptions   Home   Help 
users@ml.mod-xslt2.com
mod-xslt2 - Users Mailing List
   
 
List info
 
 
 
Subscribe
 
 
Unsubscribe
 
 
Archive
 
 
Post
 



Advanced search
2004 01 02 03 04 05 06 07 08 09 10 11 12
2005 01 02 03 04 05 06 07 08 09 10 11 12
2006 01 02 03 04 05 06 07 08 09 10 11 12
2007 01 02 03 04 05 06 07 08 09 10 11 12
2008 01 02 03 04 05 06 07 08 09 10 11 12
2010 01 02 03 04 05 06 07 08 09 10 11 12
2011 01 02 03 04 05 06 07 08 09 10 11 12

  previous   Chronological            previous   Thread       

Re: custom function? forward request Robert Koberg
  • From: Robert Koberg <rob@xxxxxxxxxx>
  • To: users@xxxxxxxxxxxxxxxx
  • Subject: Re: custom function? forward request
  • Date: Wed, 30 Jan 2008 22:29:17 -0500
  • References: <1201747017.9721.30.camel@rkoberg-laptop>
  • Reply-to: rob@xxxxxxxxxx


  • Allow me to modify a few things inline below.


    On Wed, 2008-01-30 at 21:36 -0500, Robert Koberg wrote:
    > Hi, (anybody here?)
    >
    > Brand new to mod-xslt2. I read through the docs and most of the mailing
    > list. I saw in the docs
    > (http://www.mod-xslt2.com/doc/manual.xml?sect=6#):
    >
    > "Right now, POST requests are not supported and will never be unless
    > somebody decides it worth and either works on it or bagges me to do so."
    >
    > I would like to beg for it, but rather than an extension element, a
    > custom function. (is there any way to write extensions in something like
    > python??).
    >
    > For example:
    >
    > <xsl:variable
    > name="response"
    > select="yaslt:forward($request) or yaslt:forward-request()"/>

    perhaps it would be better to add an argument for a URI to redirect to.
    For example:

    select="forward-request('local:///tomcat/some/app')"
    select="forward-request('local:///python/${someVar}/app')"
    select="forward-request(concat('local:///ruby/', $someVar, '/app')"

    >
    > 'forward' acts like the XSL document function sending the request (GET
    > or POST or ?). Then some local:/// uri handles the request and returns
    > XML which can be used in the transformation. Imagine an XHTML template
    > mapped to URIs that is used as the main XML source in the transform. The
    > 'response' variable is set as a global and used to fill in the template.
    >
    > Instant mini-framework.
    >

    Make that a non-denominational view layer.

    best,
    -Rob


    > >From reading the other docs, the way to create an 'xmlfilter' was to
    > write to a tmp file or into memory. The forward function would remove
    > that need. Even more, the XML could be written to the response stream
    > from a SAX-like writer (or just put in an xml string) to return to the
    > forward function to live in (the example above) an XSL variable (or
    > perhaps for use in apply-templates, value-of, or wherever the select
    > attribute is allowed).
    >
    > Since this XML can be streamed into the response, a DOM does not need to
    > be created making it really easy for any other server-side processing to
    > supply the response. And you get memory benefits of the optimized DOM
    > that the processor uses rather than a full DOM. I assume you probably
    > need to use something that plugs into apache like python, php, tomcat,
    > etc. (Could you forward the request to some app running on a different
    > port or server? It would probably be nice, but I don't think it is
    > necessary).
    >
    > does that make sense?
    >
    > best,
    > -Rob
    >


      Powered by Sympa