473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

getting SOAPBody elements with xsl

I have a SOAP Message like the following:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="CreateCoordinationContext.xsl"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsa:Action soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">

http://schemas.xmlsoap.org/ws/2004/1...inationContext
</wsa:Action>
<wsa:To soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">

http://dutige.st.ewi.tudelft.nl/wstf...ces/Activation
</wsa:To>
<wsa:ReplyTo soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsa:Address>urn:Initiator</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
uuid:92f447576866786d:40a96d8e:10631b4fd84:-7fff
</wsa:MessageID>
</soapenv:Header>
<soapenv:Body>
<CreateCoordinationContext
xmlns="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
<Expires>0</Expires>
<CoordinationType>http://schemas.xmlsoap.org/ws/2004/10/wsat</CoordinationType>
</CreateCoordinationContext>
</soapenv:Body>
</soapenv:Envelope>

what i would like to extract is the value of Expires and
CreateCoordinationContext elements but nothing seems to work
i tried the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/10/wscoor"
exclude-result-prefixes="soapenv" version="1.0">
<xsl:template match="/">
<html>
<body>
<h2>SOAP BODY</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Expires</th>
<th align="left">CoordinationType</th>
</tr>
<tr>
<td>
<xsl:value-of
select="/soapenv:Envelope/soapenv:Body/a:CreateCoordinationContext/a:Expires"/>
</td>
<td>
<xsl:value-of
select="/soapenv:Envelope/soapenv:Body/node()[1]/node()[2]"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
but i don't get any answer i don't see where is the problem.
Thanks in advance fo any suggestion.

Sep 22 '05 #1
1 1616
i have found the error so for anyone intersted i post it here.
first the SOAP should not have any ref to the xsl:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsa:Action
soapenv:mustUnderstand="0"xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">

http://schemas.xmlsoap.org/ws/2004/1...inationContext
</wsa:Action>
<wsa:To soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">

http://dutige.st.ewi.tudelft.nl/wstf...ces/Activation
</wsa:To>
<wsa:ReplyTo soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsa:Address>urn:Initiator</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
uuid:92f447576866786d:40a96d8e:10631b4fd84:-7fff
</wsa:MessageID>
</soapenv:Header>
<soapenv:Body>
<CreateCoordinationContext
xmlns="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
<Expires>0</Expires>

<CoordinationType>http://schemas.xmlsoap.org/ws/2004/10/wsat</CoordinationType>
</CreateCoordinationContext>
</soapenv:Body>
</soapenv:Envelope>

then the xsl should look like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor"
exclude-result-prefixes="soapenv" version="1.0">
<xsl:template match="/">
<html>
<body>
<h2>SOAP BODY</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Expires</th>
<th align="left">CoordinationType</th>
</tr>
<tr>
<td>
<xsl:value-of
select="/soapenv:Envelope/soapenv:Body/wscoor:CreateCoordinationContext/wscoor:Expires"/>
</td>
<td>
<xsl:value-of
select="/soapenv:Envelope/soapenv:Body/wscoor:CreateCoordinationContext/wscoor:CoordinationType"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

so the different namespaces have to be imported in the xsl.

Sep 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Hunter | last post by:
I have a largish data set (1000 observations x 100 floating point variables), and some of the of the data are missing. I want to try a variety of clustering, neural network, etc, algorithms on the...
0
by: Sonna Nach | last post by:
Hi All, I am writing a doc/lit web services, in which the elements under SOAPBody is unknown. That is, these two message are acceptable. 1. <SOAP-ENV:Body><Tag1>It is ok</Tag1></SOAP-ENV:Body>...
10
by: Chuck | last post by:
Hi! Any ideas as to how I can get ride of the script error undefined variable "Exp_Month"? I am trying to get this drop down list to default to the current month as opposed to 01. Thank...
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
2
by: ecomputerdelicacy | last post by:
Compact Framework SP3 (and I think also SP2 and SP1) XmlTextReader does not handle !DOCTYPE and (maybe?) rdf elements. How can I get the XmlTextReader to read these without issuing a...
6
by: Michael | last post by:
Hi All, I need a few suggestions. I have the following XML segment: <LookUp> <ControlType>CheckBoxGroup</ControlType> <DBField>LastMedDate</DBField> <ControlName>cmbGoal1</ControlName> <Values...
2
by: Michael | last post by:
Hi All, I have something going wrong with the XmlTextReader. I have a function that reads the following XML example. For some reason the code is only getting two of the 3 Values elements. Here is...
1
by: kamleshsharmadts | last post by:
I am using Ajax with struts in web application. from jsp i am calling a function of ajax.js onclick of a button. code of that call function which calling from jsp given as below:- ...
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.