Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
XSLT Help and Discussion
»
Using XSLT with SOAP
Topic
Topic Page
1
2
3
4
5
6
7
8
9
Prev Topic
Next Topic
next
Subject:
Using XSLT with SOAP
Author:
steven matthews
Date:
01 Jan 2007 03:56 PM
HI All,
I am trying to display the following simple SOAP message in a web browser using XSLT:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="calculate.xsl" type="text/xsl"?>
<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><CalculateResponse xmlns="
http://www.ntforl.com/">
<CalculateResult>0.772727251</CalculateResult>
</CalculateResponse>
</soap:Body>
</soap:Envelope>
I am using the following .xsl stylesheet (called calculate.xsl):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Web Services and SOAP messages</title>
</head>
<body>
<h3>The answer is:</h3>
<b><xsl:value-of select="soap:Body/CalculateResponse/CalculateResult"/></b>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I wish only to display the contents of CalculateResult, as follows:
<CalculateResult>0.772727251</CalculateResult>
I get an error that complains about 'soap:Body' element
Anyone got any suggestions ?
Steven Matthews
next
Subject:
Using XSLT with SOAP
Author:
Minollo I.
Date:
01 Jan 2007 09:09 PM
You are missing the definition of a few namespaces, and one step in the XPath expression; try this:
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:response="
http://www.ntforl.com/">
...
<b><xsl:value-of select="soap:Envelope/soap:Body/response:CalculateResponse/response:CalculateResult"/></b>
top
Subject:
Using XSLT with SOAP
Author:
steven matthews
Date:
02 Jan 2007 12:03 PM
Hi There,
Thanks for that, it works,
Steven M
Topic Page
1
2
3
4
5
6
7
8
9
Prev Topic
Next Topic
Powered by
Stylus Studio
, the world's leading
XML IDE
for
XML
,
XSLT
,
XQuery
,
XML Schema
,
DTD
,
XPath
,
WSDL
,
XHTML
,
SQL/XML
, and
XML Mapping
!
Go to Conference:
Select Conference
Stylus Studio Feature Requests
Stylus Studio Technical Forum
Website Feedback
XSLT Help and Discussion
XQuery Help and Discussion
Stylus Studio FAQs
Stylus Studio Code Samples & Utilities
Stylus Studio Announcements
go
Log In Options
Username:
Password:
Site Map
|
Privacy Policy
|
Terms of Use
|
Trademarks
Stylus Scoop XML Newsletter:
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.