BizTalk Server General - Xpath not returning values

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > October 2005 > Xpath not returning values





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Xpath not returning values
MNA

2005-10-13, 6:00 pm

Hi,
I am trying to use this XPath expression which is not returning
anything (Please see the XML at the end)

sValue=
xpath(WsResp.HelloWorldMethodResult,@"/*[local-name()='SomeOutput' and
namespace-uri()='http://CompanyName/webservices/']/*[local-name()='somevalue'
and namespace-uri()='http://CompanyName/webservices/']");

I also tried following but no results
xpath(WsResp.HelloWorldMethodResult,"//@somevalue")
xpath(WsResp.HelloWorldMethodResult,"//somevalue")

Here is the input XML
<ns0:SomeOutput xmlns:ns0="http://CompanyName/webservices/">
<ns0:somevalue>somevalue_0</ns0:somevalue>
<ns0:someothervalue>someothervalue_0</ns0:someothervalue>
<ns0:aClass2LevelDeep>
<ns0:aMember>aMember_0</ns0:aMember>
<ns0:anothermember>anothermember_0</ns0:anothermember>
</ns0:aClass2LevelDeep>
</ns0:SomeOutput>

Jan Eliasen

2005-10-24, 10:36 am

On 13 Oct 2005 14:58:21 -0700, "MNA" <mnadeemakhter@gmail.com> wrote:

>sValue=
>xpath(WsResp.HelloWorldMethodResult,@"/*[local-name()='SomeOutput' and
>namespace-uri()='http://CompanyName/webservices/']/*[local-name()='somevalue'
>and namespace-uri()='http://CompanyName/webservices/']");

Hi

Try removing the "@".


--
Jan Eliasen, representing himself and not the company he works for.
MNA

2005-10-24, 10:36 am

Thaanks Jan,
Yes I did try but it didn't work as you can see my origional post as

xpath(WsResp.HelloWorldMethodResult,"//@somevalue")
xpath(WsResp.HelloWorldMethodResult,"//somevalue")

Jan Eliasen

2005-10-24, 10:36 am

On 14 Oct 2005 05:05:07 -0700, "MNA" <mnadeemakhter@gmail.com> wrote:

>Thaanks Jan,
>Yes I did try but it didn't work as you can see my origional post as
>
>xpath(WsResp.HelloWorldMethodResult,"//@somevalue")
>xpath(WsResp.HelloWorldMethodResult,"//somevalue")

I meant this @:
xpath(WsResp.HelloWorldMethodResult,@"/*[local-na

I didn't mean the @ inside the xpath queries, but the @ outside it.

--
Jan Eliasen, representing himself and not the company he works for.
MNA

2005-10-24, 10:37 am

Nope still no luck. I put the @ sign in out side of th quotes but no
results.

Jan Eliasen

2005-10-24, 10:37 am

On 17 Oct 2005 08:14:52 -0700, "MNA" <mnadeemakhter@gmail.com> wrote:

>Nope still no luck. I put the @ sign in out side of th quotes but no
>results.

Hi

If you open the schema in the schemaeditor in VS.NET and click on the
element somevalue. Then on the properties of this element, there is an
XPath-property. Copy the string from this property, and use it. Does
that work?

--
Jan Eliasen, representing himself and not the company he works for.
MNA

2005-10-24, 10:37 am

Thanks Jan for your support. But no it doesn't work

Jan Eliasen

2005-10-24, 10:37 am

On 18 Oct 2005 05:54:05 -0700, "MNA" <mnadeemakhter@gmail.com> wrote:

>Thanks Jan for your support. But no it doesn't work

Well, last solution: Zip your solution directory and mail it to me - I
will take a look at it.

I will send you an email to your gmailaddress, so you can get my
address.

--
Jan Eliasen, representing himself and not the company he works for.
slawence

2005-10-28, 5:03 pm

Not sure if you ever resolved your problem but I had similar problems and
after some investigation I came to the conclusion that the xpath function
returns an object the type will be dependant on what is returned. If you
assign this to a variable that is not of the same type then the variable
seems to get the value null.

you could try something like
sValue=
xpath(WsResp.HelloWorldMethodResult,@"string(/*[local-name()='SomeOutput' and
namespace-uri()='http://CompanyName/webservices/']/*[local-name()='somevalue'
and namespace-uri()='http://CompanyName/webservices/']/text())");

to get the value between elements etc.

That said I am getting a problem using the xpath in a loop (a count
funtion)- works perfectly if you have just deployed then returns a null on
the second loop the next time!!

Hope this helps.
Steven

"Jan Eliasen" wrote:

> On 18 Oct 2005 05:54:05 -0700, "MNA" <mnadeemakhter@gmail.com> wrote:
>
> Well, last solution: Zip your solution directory and mail it to me - I
> will take a look at it.
>
> I will send you an email to your gmailaddress, so you can get my
> address.
>
> --
> Jan Eliasen, representing himself and not the company he works for.
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com