xmlspy returns output but not xpathevaluate

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,

Please help. Ive below xml

<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white <<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MAF_ApprovalRequestResponse<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white <<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MAF_ApprovalRequestResult<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white <<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MessageBody<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white <<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white ServiceMessageBodyMAF_ApprovalRequest<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white <<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white ReturnVal<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white 1<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white </<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white ReturnVal<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white </<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white ServiceMessageBodyMAF_ApprovalRequest<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white </<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MessageBody<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<p style="text-autospace:none <span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white </<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MAF_ApprovalRequestResult<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white ><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:black; background:white
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white </<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:maroon; background:white MAF_ApprovalRequestResponse<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white >

<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white None of these xpaths return value. I dont understand what is going wrong when XMLSpy returns the values.
<span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:blue; background:white
//ServiceMessageBodyMAF_ApprovalRequest/ReturnVal/text()
string(//ServiceMessageBodyMAF_ApprovalRequest/ReturnVal)
string(//text())

Below is my code

<pre style="font-family:consolas <pre style="font-family:consolas <span style="color:blue var xml = <span style="color:#2b91af XDocument.Parse(xmlStr);<br/>[/code]
[/code]
<pre style="font-family:consolas xType = xml.CreateNavigator().Compile(xpath);<br/> <br/> <br/> Result.Set(context, response);<br/><br/> <span style="color:blue var nodes = xml.XPathEvaluate(xpath);[/code]
<pre style="font-family:consolas <br/>[/code]
<pre style="font-family:consolas nodes has empty details within itself.[/code]
<pre style="font-family:consolas <br/>[/code]
<pre style="font-family:consolas Kavya[/code]



<
Peace, Kavya<br/>

View the full article
 
Back
Top