473,574 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:

<EmailListRespo nse xmlns="http://BTTest">
<PersonContac t EMailContactVal ue="te***@mail. com" />
<PersonContac t EMailContactVal ue="te***@mail. com" />
</EmailListRespon se>
My xpath expression which generates the error message:

varNoOfEmailAdd resses = (System.Int32)x path(msgEmailLi stRes, "count(/
*[local-name()='EmailLi stResponse']/*[local-name()='PersonC ontact']/
*[[local-name()='EMailCo ntactValue']
[not(text()=prec eding::EMailCon tactValue/text())])");

varNoOfEmailAdd resses 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>20070 130_12</SHTRefId>
<SentAt>2007-01-30T00:00:00</SentAt>
</Header>
- <Body xmlns="">
- <VesselIdentifi cation>
<IMONumber>3424 </IMONumber>
<MMSINumber>234 24</MMSINumber>
<CallSign>234 </CallSign>
<ShipName>20070 130_12</ShipName>
</VesselIdentific ation>
- <AISInformation >
<Longitude>3234 </Longitude>
<Latitude>23423 4</Latitude>
<Timestamp>20 07-01-30T00:00:00</Timestamp>
<Destination>23 4</Destination>
</AISInformation>
- <NotifyCountrie s>
<CountryCode>NO R</CountryCode>
</NotifyCountries >
</Body>
</SHT_Req>

varNoOfCountrie s = (System.Int32)x path(msgSHT_Req , "count(/*[local-
name()='SHT_Req ']/*[local-name()='Body']/*[local-
name()='NotifyC ountries']/*[local-name()='Country Code']
[not(text()=prec eding::CountryC ode/text())])");

varNoOfCountrie s is a local orchestration variable
msgSHT_Req is a local orchestration message

Jan 30 '07 #1
2 14812
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:

<EmailListRespo nse xmlns="http://BTTest">
<PersonContac t EMailContactVal ue="te***@mail. com" />
<PersonContac t EMailContactVal ue="te***@mail. com" />
</EmailListRespon se>
My xpath expression which generates the error message:

varNoOfEmailAdd resses = (System.Int32)x path(msgEmailLi stRes, "count(/
*[local-name()='EmailLi stResponse']/*[local-name()='PersonC ontact']/
*[[local-name()='EMailCo ntactValue']
[not(text()=prec eding::EMailCon tactValue/text())])");
You are at least not properly dealing with the EMailContactVal ue
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()='EmailLi stResponse']/*[local-name()='PersonC ontact']
[not(@EMailConta ctValue=precedi ng::*/@EMailContactVa lue)])

It counts the elements with local name being 'PersonContact' for which
the attribute condition
not(@EMailConta ctValue=precedi ng::*/@EMailContactVa lue) 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:

<EmailListRespo nse xmlns="http://BTTest">
<PersonContac t EMailContactVal ue="te***@mail. com" />
<PersonContac t EMailContactVal ue="te***@mail. com" />
</EmailListRespon se>
My xpath expression which generates the error message:

varNoOfEmailAdd resses = (System.Int32)x path(msgEmailLi stRes, "count(/
*[local-name()='EmailLi stResponse']/*[local-name()='PersonC ontact']/
*[[local-name()='EMailCo ntactValue']
[not(text()=prec eding::EMailCon tactValue/text())])");

varNoOfEmailAdd resses 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>20070 130_12</SHTRefId>
<SentAt>2007-01-30T00:00:00</SentAt>
</Header>
- <Body xmlns="">
- <VesselIdentifi cation>
<IMONumber>3424 </IMONumber>
<MMSINumber>234 24</MMSINumber>
<CallSign>234 </CallSign>
<ShipName>20070 130_12</ShipName>
</VesselIdentific ation>
- <AISInformation >
<Longitude>3234 </Longitude>
<Latitude>23423 4</Latitude>
<Timestamp>20 07-01-30T00:00:00</Timestamp>
<Destination>23 4</Destination>
</AISInformation>
- <NotifyCountrie s>
<CountryCode>NO R</CountryCode>
</NotifyCountries >
</Body>
</SHT_Req>

varNoOfCountrie s = (System.Int32)x path(msgSHT_Req , "count(/*[local-
name()='SHT_Req ']/*[local-name()='Body']/*[local-
name()='NotifyC ountries']/*[local-name()='Country Code']
[not(text()=prec eding::CountryC ode/text())])");

varNoOfCountrie s 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
5452
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 the node described by the xpath expression, to the new value.
1
4268
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 > eg "/root/person" node = <name of a child node in repeat path> eg" "name" Now, I want to get to the 'node' in XSLT using Xpath.
1
1911
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 evaluate the xpath expression. Is there a way to get some context information into an extension object?
1
3089
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 context.nextNode().selectNodes(expression);
3
8014
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
6769
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 understand it, xpath doesn't yet have regular expressions so I thought to do: function findNode (srch) { var node; var expr="//td"; var RE = new...
2
15770
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 generic (LIST<T>) This method is calculed often before is put in a foreach statement. At the first iterration, all is ok. But at the seond, I receive...
3
2260
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 seen examples where people build up the xpath themselves by walking the DOM, but I thought there has to be a better way. I've included a simple...
4
8767
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 the node does not exist but that is also the result for an empty node. -- thanks - dave david_at_windward_dot_net
11
2563
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( req.responseXML.getElementsByTagName(req.parameters.root),true)) (lines 46/47) in case of SVG : req.parameters.root = 'svg' and 'math' in case of MathML
0
7815
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3756
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3770
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2254
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.