cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alten, Jelle Paul" <jelle.paul.al...@ordina.nl>
Subject RE: Cocoon and soap
Date Tue, 10 Feb 2004 22:04:02 GMT
Hi Anna,

Well, what I'd try: you can make a pipeline that calls the soap server,
transform the result into html and serialize it...

for example: 
make a pipeline like this:

     <map:generate
src="http://www.soapserver.com/soaprequest?reqarg=argvalue"/>
     <map:transform src="transforms/soap2html.xsl">
     <map:serialize/>


where the generate src should point to your soapserver with the right
request
and the soap2html.xsl in the transforms directory would be somethink like
the following transformation (I just hacked it up for you, hope it shows
what you can do. 

greetings,

Jelle

-->> transforms/soap2html.xsl  <<--


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">
	<html>
		<head>
			<title>SOAP Message</title>
			<style type="text/css">
				code {color: #808080;}
			</style>
		</head>
		<body>
			<table border="1">
				<xsl:for-each select="*">
					<tr>
						<th><xsl:value-of
select="name()"/></th>
						<td><xsl:apply-templates
select="." mode="value"/></td>
					</tr>
				</xsl:for-each>
			</table>
		</body>
	</html>
</xsl:template>

<xsl:template match="*[not(*) and count(text())=1]">
	<tr>
		<th><xsl:value-of select="name()"/></th>
		<td><xsl:value-of select="."/></td>
	</tr>
</xsl:template>

<xsl:template match="*">
	<tr>
		<td colspan="2">
			<xsl:for-each select="@*">
				<xsl:if test="position()>1"><br/></xsl:if>
				<code><xsl:value-of
select="name()"/>=<xsl:value-of select="."/></code>
			</xsl:for-each>
		</td>
	</tr>
	<xsl:for-each select="*">
		<tr>
			<th><xsl:value-of select="name()"/></th>
			<td><xsl:apply-templates select="."
mode="value"/></td>
		</tr>
	</xsl:for-each>

</xsl:template>

<xsl:template match="*[*]" mode="value">
	<table border="1"><xsl:apply-templates select="."/></table>
</xsl:template>


</xsl:stylesheet>




-->> end of file <<--





-----Oorspronkelijk bericht-----
Van: Anna Bikkina [mailto:anna@pinksheets.com]
Verzonden: dinsdag 10 februari 2004 21:47
Aan: users@cocoon.apache.org
Onderwerp: Cocoon and soap


Hi all,

I am trying to write a cocoon page which talks to a soap server . The soap 
envelope  has an xml file. I have to display this xml file as html using 
cocoon. Can anyone tell me how I can do that in cocoon. Below is my soap 
envelope.

-<soapenv:Envelope> 
	+<soapenv:Body> 
		+<ns1:sayHelloResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/"> 
			<ns1:sayHelloReturn href="#id0"/> 
		</ns1:sayHelloResponse> 
	 	+<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://

schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Document"> 
			-<slideshow title="SampleSlide Show"> 
				-<slide> 
					<title>Overview</title> 
					<item>n1</item> 
				</slide> 
				-<slide> 
					<title>Introduction</title> 
					<item>check this out</item> 
				</slide> 
			</slideshow> 
		</multiRef> 
	</soapenv:Body> 
</soapenv:Envelope> 

Thanks in advance,
Anna.


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

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


Mime
View raw message