cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scott <sc...@evolove.net>
Subject help with capture logicsheet
Date Fri, 15 Aug 2003 14:33:53 GMT
I've been looking at using the capture logicsheet to get a value from a SOAP
payload. I think I'm _almost_ there. In the following code, I can capture the
data I want into a variable, which is of type
"org.apache.cocoon.components.sax.XMLByteStreamFragment"

So now I just want to know how I can query that object for the value of the xml,
which is of the format "<b>555</b>" - that's all I want, the "555". Code
fragment is below. Any help appreciated!

---
<xscript:variable name="soap-result">
  <soap:call url="blahblahsomesoapurl"
        xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/1999/XMLSchema">
     <ns1:login xmlns:ns1="http://www.soapware.org/">
      <username xsi:type="xsd:string">link</username>
      <password xsi:type="xsd:string">link</password>
     </ns1:login>
   </soap:call>
</xscript:variable>

<xscript:variable name="stylesheet">
   <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:ns1="http://www.soapware.org/"
                  exclude-result-prefixes="SOAP-ENV ns1">
    <xsl:template match="/">
    	<b>
        <xsl:value-of
select="/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:loginResponse/sessionid"/>
        </b>
        <!-- <xsl:value-of select="/SOAP-ENV:Envelope"/> -->
    </xsl:template>
  </xsl:stylesheet>
</xscript:variable>

<!-- <xscript:transform name="soap-result" stylesheet="stylesheet"/> -->

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

<capture:fragment-variable name="scottTest">
	<xscript:transform name="soap-result" stylesheet="stylesheet"/>
</capture:fragment-variable>

<xsp:logic>
	System.out.println("%%%%%% wheee nee!");
	System.out.println("scottTest:"+scottTest);
	System.out.println("scottTestDom:"+scottTestDom.getClass().getName());
</xsp:logic>

<xsp:expr>scottTest</xsp:expr>

----
Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message