Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

'invalid xpath expression' in helper class

10 views
Skip to first unread message

BizTalk4Ever

unread,
Oct 17, 2006, 10:10:57 AM10/17/06
to
I am using a helper class in my BT Orchestration which uses some xpath
queries. The helper class was prototyped in WinForms where it works
pretty fine. Strange, because the same helper class with the same xpath
query in BT Orch gives me a different result (XpathNodeIterator.Count =
0). Furthermore, i checked the xpath query string from the helper class
in my BT Orch. With XPathmania the xpath query string gives me valid
result with the loaded xml document. Has anyone an idea ?

Jan Eliasen

unread,
Oct 18, 2006, 9:22:19 AM10/18/06
to

It is difficult to say. From the helperclass try writing the
xmldocument.OuterXml to a file and attach it to your post along with
the xpath query. Maybe someone can help you.

--
eliasen, representing himself and not the company he works for.

Private blog: http://blog.eliasen.dk

Private email: j...@eliasen.dk

BizTalk4Ever

unread,
Oct 19, 2006, 4:47:55 AM10/19/06
to
Hi Jan,
thanx 4 ur advise.
Below is my xml doc and the xpath query expression, which always gives
me a valid return value, when called from the WinForm client or from an
xml xpath query tool. But running this xpath query in Biztalk inside my
c# helper class i got XpathNodeIterator.Count =0.
What is also interseting is the fact that the upper levels from the
Node "Element" return valid results, but not from the Node Level
"/Parameters/Parameters/...".
Is there any diferences in processing the xpath queries inside the BT
Orch compared to the WinForms .Net Environment ? If anybody has an idea
i would appreciate this.

START XML DOCUMENT>>
<?xml version="1.0" encoding="utf-8"?><ns3:order
xmlns:ns1="http://www.foofoo.org/ord/schemas/history"
xmlns:ns3="http://www.foofoo.org/schemas/ord/orderdesk"
xmlns:ns4="http://www.foofoo.org/schemas/ord/element"
xmlns:ns2="http://www.foofoo.org/schemas/ord/modul/orderdesk"
xmlns:ns0="http://www.foofoo.org/schemas/ord/header"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><flowMessageType>0uief06e-76f7-4e7c-abd7-38ce5eb24141</flowMessageType><flowIdentifier>42d65d57-47f5-4c43-9388-4ec3bc637d04</flowIdentifier><ns0:header><orderStatus>provisioning</orderStatus><orderDate>2006-10-10T12:53:12.052+02:00</orderDate><orderIdentifier></orderIdentifier><customer><customerIdentifier>201</customerIdentifier><customerName></customerName>
</customer></ns0:header><moduls><ns2:modul
modulOrderIdentifier="1344f31b-a500-d3355-9ef9-996987bdd2e"><modulIdentifier>101</modulIdentifier><name>New
Collection</name><description></description><price>0</price><supplier></supplier><dateSLA>2006-11-24T00:00:00+01:00</dateSLA><language>DE</language><employee><employeeIdentifier>3101</employeeIdentifier><employeeName>Sheng
Whuu</employeeName>

</employee><location><locationIdentifier>225</locationIdentifier><city></city><zip></zip><street></street><streetNbr></streetNbr><country>GB</country>
</location><elements><ns4:element elementOrderAction="add"
elementOrderIdentifier="6f1efd78-1591-49cf-8e5d-e2ecb7238499"><elementIdentifier>12901</elementIdentifier><supplier>IT</supplier><manufacturer></manufacturer><name>Levis
501 small
fit</name><description></description><itemPrice>0</itemPrice><amount>0</amount><parameters><parameter><key>Artikelbezeichnung</key><value></value>
</parameter>
</parameters>
</ns4:element><ns4:element elementOrderAction="add"
elementOrderIdentifier="85nd36be-3d63-4e08-ccfa-c27f9e86182d"><elementIdentifier>13601</elementIdentifier><supplier>IT</supplier><manufacturer></manufacturer><name>Levis
T-Shirt
406</name><description></description><itemPrice>0</itemPrice><amount>0</amount><parameters><parameter><key>Artikelbezeichnung</key><value></value>
</parameter>
<parameter>
<key>ProductID</key>
<value>2390945</value>
</parameter>
</parameters>
</ns4:element><ns4:element elementOrderAction="add"
elementOrderIdentifier="bkk316be-t03a-663d-rr4-h86f20z7c558"><elementIdentifier>14401</elementIdentifier><supplier>IT</supplier><manufacturer></manufacturer><name>Otpical
Scroll
Mouse</name><description></description><itemPrice>0</itemPrice><amount>0</amount><parameters><parameter><key>Artikelbezeichnung</key><value></value>
</parameter>
</parameters>
</ns4:element><ns4:element elementOrderAction="add"
elementOrderIdentifier="56be607d-397e-de73-9294-f32dr7e120f7"><elementIdentifier>13801</elementIdentifier><supplier>IT</supplier><manufacturer></manufacturer><name>Levis
Leather belt
red</name><description></description><itemPrice>0</itemPrice><amount>0</amount><parameters><parameter><key>Artikelbezeichnung</key><value></value>
</parameter>
</parameters>
</ns4:element></elements></ns2:modul></moduls></ns3:order>
<< END XML DOCUMENT


START XPATH QUERY>>
/*[local-name()='order' and
namespace-uri()='http://www.foofoo.org/schemas/ord/orderdesk']/*[local-name()='moduls'
and namespace-uri()='']/*[local-name()='modul' and
namespace-uri()='http://www.foofoo.org/schemas/ord/modul/orderdesk']/*[local-name()='elements'
and namespace-uri()='']/*[local-name()='element' and
namespace-uri()='http://www.foofoo.org/schemas/ord/element'][@elementOrderIdentifier='85nd36be-3d63-4e08-ccfa-c27f9e86182d']/*[local-name()='parameters']/*[local-name()='parameter'][key='ProductID']/*[local-name()='value']/text()
<< END XPATH QUERY
Jan Eliasen schrieb:

Jan Eliasen

unread,
Oct 19, 2006, 5:00:48 PM10/19/06
to
On 19 Oct 2006 01:47:55 -0700, "BizTalk4Ever" <pa...@endras.de> wrote:

>Below is my xml doc and the xpath query expression, which always gives
>me a valid return value, when called from the WinForm client or from an
>xml xpath query tool. But running this xpath query in Biztalk inside my
>c# helper class i got XpathNodeIterator.Count =0.

Right. Well, if the XPAth always returns valid results when run
outside the orchestration, then my best beet would be that the
instance inside the orchestration is erroneous (spelling?). ave you
tried debugging your orchestration, setting a breakpoint just before
the shape where the xpath expression is used? And have you then
valdated that the message has in fact the correct content that matches
the xpath query?

BizTalk4Ever

unread,
Oct 22, 2006, 10:57:30 AM10/22/06
to
Hi Jan,
yes, i made all these precaution debugging things. I write out several
information about the current operation state(variables etc...) inside
the BT Orch to the Eventlog, to narrow the place of failure. There i
see that exactly this xpath query i mentioned before delivers a
different return value of 0.
This is not what i excepted at all.
I am using the Select Method to pass the ypath query and use the
iterator object to loop through the resultsets. In the WinForms App it
works and in the BTO not.

Any idea would highly appreciated !

Jan Eliasen

unread,
Oct 22, 2006, 2:36:54 PM10/22/06
to
On 22 Oct 2006 07:57:30 -0700, "BizTalk4Ever" <pa...@endras.de> wrote:

>Any idea would highly appreciated !

I am out of ideas. If you email me your project, I can take a look at
it. Should you email me, please refer to this thread in your email, so
I can find the description of your issue easier.

rclb

unread,
Oct 24, 2006, 9:03:10 AM10/24/06
to
Have you tried using a namespace unaware xpath like:

/*[local-name()='order']/*[local-name()='moduls']/*[local-name()='modul']/*[local-name()='elements']/*[local-name()
=
'element'][@elementOrderIdentifier='85nd36be-3d63-4e08-ccfa-c27f9e86182d']/*[local-name()='parameters']/*[local-name()='parameter'][key='ProductID']/*[local-name()='value']

Also, check the ElementFormDefault property of your schema. Is it
Qualified or not?

rclb

unread,
Oct 24, 2006, 9:07:09 AM10/24/06
to
Also, I just noticed you should change your 'key' element reference to
use full xpath:

Change:

local-name()='parameter'][key='ProductID']

To:

*[local-name() = 'parameter'][*[local-name() = 'key']='ProductID']

BizTalk4Ever

unread,
Oct 27, 2006, 6:26:59 AM10/27/06
to
Hi rclb,
thank you for your comments on the xpath. THAT'S THE SOLUTION !!! In
fact the <key>
node has to specified in this xpath query to work well. Your answer
was of great use for me.
THANK YOU !

rclb schrieb:

Very nice site! Good work. http://www.sessit.port5.com

unread,
Feb 28, 2007, 3:25:27 PM2/28/07
to

Very nice site! Good work. http://www.sessit.port5.com

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities

Nice design, good graphical content. I think I'll come back later again;) http://phentermines.forum-on.de

unread,
Mar 9, 2007, 11:39:53 AM3/9/07
to

Nice design, good graphical content. I think I'll come back later again;) http://phentermines.forum-on.de

mmm.. nice design, I must say.. http://www.paradistc.org/italia

unread,
Mar 12, 2007, 4:02:08 AM3/12/07
to

mmm.. nice design, I must say.. http://www.paradistc.org/italia

Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.paradistc.org/liberi

unread,
Mar 14, 2007, 7:08:51 PM3/14/07
to

Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.paradistc.org/liberi

i'am really impressed!! http://www.sanzkdni59.org/libera

unread,
Mar 16, 2007, 6:01:35 PM3/16/07
to

i'am really impressed!! http://www.sanzkdni59.org/libera

luogo grande:) nessun osservazioni! http://www.paradistc.org/sardinia

unread,
Mar 18, 2007, 9:25:16 AM3/18/07
to

luogo grande:) nessun osservazioni! http://www.paradistc.org/sardinia

Chi ha fatto questo? E un buon posto per trovare le informazioni importanti!:) http://www.sanzkdni59.org/formula-1

unread,
Mar 20, 2007, 12:25:50 AM3/20/07
to

Chi ha fatto questo? E un buon posto per trovare le informazioni importanti!:) http://www.sanzkdni59.org/formula-1

Lavoro eccellente! ..ringraziamenti per le informazioni..realmente lo apprezzo: D http://www.sanzkdni59.org/del-piero

unread,
Mar 20, 2007, 5:37:53 PM3/20/07
to

Lavoro eccellente! ..ringraziamenti per le informazioni..realmente lo apprezzo: D http://www.sanzkdni59.org/del-piero

Interessieren. SEHR interessant! ;) http://www.circumno3.org/sesso

unread,
Mar 30, 2007, 11:01:27 PM3/30/07
to

Interessieren. SEHR interessant! ;) http://www.circumno3.org/sesso

Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.circumno3.org/guerra

unread,
Mar 31, 2007, 3:06:55 AM3/31/07
to

Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast! http://www.circumno3.org/guerra

L'information interessante que vous avez! I'am allant revenir bientot. http://www.qukeartiere90.org/valentino-rossi

unread,
Mar 31, 2007, 7:14:49 AM3/31/07
to

L'information interessante que vous avez! I'am allant revenir bientot. http://www.qukeartiere90.org/valentino-rossi

Ich erklare meinen Freunden uber diese Seite. Interessieren! http://www.qukeartiere90.org/erotismo

unread,
Mar 31, 2007, 11:12:55 AM3/31/07
to

Ich erklare meinen Freunden uber diese Seite. Interessieren! http://www.qukeartiere90.org/erotismo

Grande sito!! http://www.qukeartiere90.org/guerra-vida-wallpaper

unread,
Mar 31, 2007, 3:09:55 PM3/31/07
to
0 new messages