The capture logicsheet allows you to get parts of your XML as an XMLFragment object or as a DOM node, apparently.

I think this might be useful for post-processing SOAP calls from XSP! There is a very brief reference to capture in the "Cocoon developers handbook", but not much.

See api docs

Code Sample

<capture:dom-variable name="blahDom">
  <blah>you are the one, mr blah</blah>

Will insert <blah>you are the one, mr blah</blah> into your xml

XSPCature and SOAP

note, unfinished As an example, you might want to deal with your returned SOAP data. This technique allows us to inspect the returned SOAP result and extract data from it. This technique uses inline xslt, which is interesting in itself. Note the inspiration from this came from the getquote2.xsp in /samples/soap/pages/xscript.

<xscript:variable name="soap-result">
  <soap:call url=""
     <ns1:login xmlns:ns1="">
      <username xsi:type="xsd:string">someusername</username>
      <password xsi:type="xsd:string">somepassword</password>

<xscript:variable name="stylesheet">
   <xsl:stylesheet version="1.0"
                  exclude-result-prefixes="SOAP-ENV ns1">
    <xsl:template match="/">
        <xsl:value-of select="/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:loginResponse/sessionid"/>
        <!-- <xsl:value-of select="/SOAP-ENV:Envelope"/> -->

<capture:dom-variable name="testDomFragment">
  <xscript:transform name="soap-result" stylesheet="stylesheet"/>

XSPCapture (last edited 2009-09-20 23:42:17 by localhost)