I would like to access the HTTP headers that from the response for an xforms:submission to eXist.
The processor details are below ... I found an earlier post that mentioned using xforms:insert and event('response-headers') but I'm struggling to see how to implement that, and access the output, from within the processor/pipeline. Any help welcome. Thanks Paul <p:processor name="oxf:xforms-submission"> <p:input name="submission"> <xforms:submission method="get" action="http://localhost:8088/db/queries/legislation.xq" separator="&"/> </p:input> <p:input name="request" href="#instance" transform="oxf:xslt"> <parameters xsl:version="2.0"> <xsl:sequence select="/parameters/type" /> <year> <xsl:choose> <xsl:when test="/parameters/monarch != ''"> <xsl:value-of select="/parameters/monarch" />_<xsl:value-of select="/parameters/year" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="/parameters/year" /> </xsl:otherwise> </xsl:choose> </year> <xsl:sequence select="/parameters/number" /> </parameters> </p:input> <p:output name="response" id="xmlData" /> </p:processor> |
Administrator
|
Paul,
I think you'll be able to use event('response-headers') on xforms-submit-done, and then you can maybe insert an element to the result that contains a the value for the header your are interested in. Something like: <xforms:submission method="get" action="http://localhost:8088/db/queries/legislation.xq" separator="&"> <xforms:action ev:event="xforms-submit-done"> <xforms:insert context="." origin="xxforms:element('gaga', event('response-headers')[name = 'gaga']/value)"/> </xforms:action> </xforms:submission> Alex |
That worked fine, many thanks.
Although ... it's a little cumbersome having to insert the information into the response. It would be better to be able to pick it up separately - but I can certainly work with it as is. Paul
|
Administrator
|
Paul,
You can have a separate instance for this, where you just store the value of the headers you are interested in when you do a submission. Thinking about it, this is most likely how I would implement it. Alex |
Free forum by Nabble | Edit this page |