BizTalk Server General - xpath not working in decision rule expression

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2006 > xpath not working in decision rule expression





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 working in decision rule expression
Jeremy Chapman

2006-06-26, 7:17 pm

I have a response message comming back from a web service call, and I'm
trying to do a comparison using xpath in a decision shape. This should be
simple but I can't get it to work.

The message in xml format looks like this:

<?xml version="1.0" ?>
<ResultValue xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Type="Error"
xmlns="http://www.test.ca/Schema">
<Messages>
<string>Unable to resolve MRN from PHN '1234'.</string>
</Messages>
</ResultValue>

and my xpath statement in my decision rule expression looks like this:
(System. String)(xpath(msgUploadDocumentsResponse
.UploadDocumentsResult,"/*[local-name()='ResultValue']/@*[local-name()='Type']"))
== "Error"

The comparison never seems to resolve to true but it should. Any ideas?



Jeremy Chapman

2006-06-26, 7:17 pm

Nevermind, I figured it out, the correct syntax is
(System. String)(xpath(msgUploadDocumentsResponse
.UploadDocumentsResult,"string(/*[local-name()='ResultValue']/@*[local-name()='Type'])"))
== "Error"


"Jeremy Chapman" <please@Idontlikespam> wrote in message
news:ehUIb1UmGHA.748@TK2MSFTNGP02.phx.gbl...
>I have a response message comming back from a web service call, and I'm
>trying to do a comparison using xpath in a decision shape. This should be
>simple but I can't get it to work.
>
> The message in xml format looks like this:
>
> <?xml version="1.0" ?>
> <ResultValue xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Type="Error"
> xmlns="http://www.test.ca/Schema">
> <Messages>
> <string>Unable to resolve MRN from PHN '1234'.</string>
> </Messages>
> </ResultValue>
>
> and my xpath statement in my decision rule expression looks like this:
> (System. String)(xpath(msgUploadDocumentsResponse
.UploadDocumentsResult,"/*[local-name()='ResultValue']/@*[local-name()='Type']"))
> == "Error"
>
> The comparison never seems to resolve to true but it should. Any ideas?
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com