User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 427,201 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,280 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums

Trouble with SOAP and xslt

Join Date: Mar 2008
Posts: 3
Reputation: ramabahama is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ramabahama ramabahama is offline Offline
Newbie Poster

Trouble with SOAP and xslt

  #1  
Mar 21st, 2008
I'm trying to run a SOAP response from a web service through an xslt translation and place it in a web page via an Ajax call. The web service and javascript all works fine. I am having a problem accessing specific nodes inside the xslt file.

Specifically: when I run the SOAP response through <xsl:for-each select="//*"> I can get all the correct node names in the response and their associated values. However when I try to access via <xsl:for-each select="//getStringResult"> I get absolutely nothing.

Here's an example of the SOAP response
<?xml version="1.0" encoding="utf-i"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getStringResponse xmlns="http://ramabahama.net/webservices">
<getStringResult>
<Salutation>String value as expected</Salutation>
<Id>Integer as expected</Id>
</getStringResult>
</getStringResponse>
</soap:Body>
</soap:Envelope>

Here's the xslt file
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" indent="yes" media-type="text/html" />
	<xsl:template match="/">
		<table border="2px" cellspacing="10px">
			<xsl:for-each select="//*">
				<tr>
					<td style="border: solid thin green; padding: 10px; text-align: left; vertical-align: middle;">
						<xsl:value-of select="current()" />
					</td>
					<td style="border: solid thin green; padding: 10px; text-align: left; vertical-align: middle;">
						<xsl:value-of select="name()" />
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>
</xsl:stylesheet>

Any idea why I'm having problems with my XPath usage? Thanks.
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 10:40 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC