473,396 Members | 1,998 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,396 software developers and data experts.

Expression must evaluate to a node-set

I am using xpath within a BizTalk 2006 orchestration.
I get the following error "Expression must evaluate to a node-set".

My xml:

<EmailListResponse xmlns="http://BTTest">
<PersonContact EMailContactValue="te***@mail.com" />
<PersonContact EMailContactValue="te***@mail.com" />
</EmailListResponse>
My xpath expression which generates the error message:

varNoOfEmailAddresses = (System.Int32)xpath(msgEmailListRes, "count(/
*[local-name()='EmailListResponse']/*[local-name()='PersonContact']/
*[[local-name()='EMailContactValue']
[not(text()=preceding::EMailContactValue/text())])");

varNoOfEmailAddresses is a local orchestration variable
msgEmailListRes is a local orchestration message
Kan anyone tell me what I am doing wrong?
I have the following xml and xpath expression, which does not fail
(very similar):

<SHT_Req xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
BTTest.Schemas.SHT_Req">
- <Header xmlns="">
<SHTRefId>20070130_12</SHTRefId>
<SentAt>2007-01-30T00:00:00</SentAt>
</Header>
- <Body xmlns="">
- <VesselIdentification>
<IMONumber>3424</IMONumber>
<MMSINumber>23424</MMSINumber>
<CallSign>234</CallSign>
<ShipName>20070130_12</ShipName>
</VesselIdentification>
- <AISInformation>
<Longitude>3234</Longitude>
<Latitude>234234</Latitude>
<Timestamp>2007-01-30T00:00:00</Timestamp>
<Destination>234</Destination>
</AISInformation>
- <NotifyCountries>
<CountryCode>NOR</CountryCode>
</NotifyCountries>
</Body>
</SHT_Req>

varNoOfCountries = (System.Int32)xpath(msgSHT_Req, "count(/*[local-
name()='SHT_Req']/*[local-name()='Body']/*[local-
name()='NotifyCountries']/*[local-name()='CountryCode']
[not(text()=preceding::CountryCode/text())])");

varNoOfCountries is a local orchestration variable
msgSHT_Req is a local orchestration message

Jan 30 '07 #1
2 14794
an*************@hotmail.com wrote:
I am using xpath within a BizTalk 2006 orchestration.
I get the following error "Expression must evaluate to a node-set".

My xml:

<EmailListResponse xmlns="http://BTTest">
<PersonContact EMailContactValue="te***@mail.com" />
<PersonContact EMailContactValue="te***@mail.com" />
</EmailListResponse>
My xpath expression which generates the error message:

varNoOfEmailAddresses = (System.Int32)xpath(msgEmailListRes, "count(/
*[local-name()='EmailListResponse']/*[local-name()='PersonContact']/
*[[local-name()='EMailContactValue']
[not(text()=preceding::EMailContactValue/text())])");
You are at least not properly dealing with the EMailContactValue
attributes in the XML as your XPath only looks at elements. I am not
sure what you want to achieve, does this XPath help?

count(/*[local-name()='EmailListResponse']/*[local-name()='PersonContact']
[not(@EMailContactValue=preceding::*/@EMailContactValue)])

It counts the elements with local name being 'PersonContact' for which
the attribute condition
not(@EMailContactValue=preceding::*/@EMailContactValue) holds.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 30 '07 #2
I am using xpath within a BizTalk 2006 orchestration.
I get the following error "Expression must evaluate to a node-set".

My xml:

<EmailListResponse xmlns="http://BTTest">
<PersonContact EMailContactValue="te***@mail.com" />
<PersonContact EMailContactValue="te***@mail.com" />
</EmailListResponse>
My xpath expression which generates the error message:

varNoOfEmailAddresses = (System.Int32)xpath(msgEmailListRes, "count(/
*[local-name()='EmailListResponse']/*[local-name()='PersonContact']/
*[[local-name()='EMailContactValue']
[not(text()=preceding::EMailContactValue/text())])");

varNoOfEmailAddresses is a local orchestration variable
msgEmailListRes is a local orchestration message
Kan anyone tell me what I am doing wrong?
I have the following xml and xpath expression, which does not fail
(very similar):

<SHT_Req xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
BTTest.Schemas.SHT_Req">
- <Header xmlns="">
<SHTRefId>20070130_12</SHTRefId>
<SentAt>2007-01-30T00:00:00</SentAt>
</Header>
- <Body xmlns="">
- <VesselIdentification>
<IMONumber>3424</IMONumber>
<MMSINumber>23424</MMSINumber>
<CallSign>234</CallSign>
<ShipName>20070130_12</ShipName>
</VesselIdentification>
- <AISInformation>
<Longitude>3234</Longitude>
<Latitude>234234</Latitude>
<Timestamp>2007-01-30T00:00:00</Timestamp>
<Destination>234</Destination>
</AISInformation>
- <NotifyCountries>
<CountryCode>NOR</CountryCode>
</NotifyCountries>
</Body>
</SHT_Req>

varNoOfCountries = (System.Int32)xpath(msgSHT_Req, "count(/*[local-
name()='SHT_Req']/*[local-name()='Body']/*[local-
name()='NotifyCountries']/*[local-name()='CountryCode']
[not(text()=preceding::CountryCode/text())])");

varNoOfCountries is a local orchestration variable
msgSHT_Req is a local orchestration message
what is the cost of your csc steel and other csc programes

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
Mar 2 '07 #3

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

Similar topics

1
by: kurt hansen | last post by:
hi I thought that this would be easy, but maybe not so much. I want to: pass an xpath expression and a string value to a stylesheet and copy the source xml document, changing the value of...
1
by: Murtaza Tinwala | last post by:
Hi mates, I have the following problem in XSLT. I have following variables: ref-file = <path of XML document> eg "xmlDoc.xml" repeatpath = <a repeat path expressed in Xpath like /root/person >...
1
by: Christoph Putz | last post by:
Hi! How can i do somewhat like saxon:evaluate in my xslt transformation? I tried to write an extension object, but in my case i need some context information (the value of an xslt-variable) to...
1
by: David Laub | last post by:
I have no problems running the following dynamic XPath evaluator form MSXSL: <msxsl:script implements-prefix="dyn" language="jscript"> evaluate(context, expression) { return...
3
by: Coco | last post by:
Hi! Does c# has any class method that will be able to evaluate a given string e.g ((True && False) || (True && True)) and return the result in boolean for this case is true Thanks!
5
by: Csaba Gabor | last post by:
In Firefox 1.5 (this question is Mozilla specific as I am using greasemonkey) I would like to be able to use document.evaluate to return the first TD entry that shows ^\s*MySearchText\s*$. As I...
2
by: steevehetu18 | last post by:
Hi, I'm doing a algorithm to calcule Earliest Start et Latest Start for a Graph with Nodes and Arcs. (like a PERT diagram) . Unfortunatly, i receive a wierd exception message for a specific...
3
by: Jeff | last post by:
Hi all, I'm wondering if there is a function that will return the xpath to a specific node given its context node. Essentially, I want the reverse of the document.evaluate functionality. I've...
4
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
Hi; If I have an XPathNavigator object and for a given xpath statement need to know if the node exists, how should I do this? I have found for some xpath functions it returns an empty string if...
11
by: =?ISO-8859-1?Q?Une_B=E9v?==?ISO-8859-1?Q?ue?= | last post by:
at the page : <http://thoraval.yvon.free.fr/Fixed_layout/import_nodes.xhtml> when importing an svg document i have to do : document.importNode(...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.