BizTalk Server Orchestration - XPath issue

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > January 2005 > XPath issue





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 issue
Alicia

2005-01-21, 5:50 pm

Hello all,

Here is a simple question, I hope.

I have a message coming in, with the following data/structure:

<?xml version="1.0" encoding="utf-8" ?>
<ns0:Root xmlns:bx=http://IAS.bxLoad.schemas.bxCommonRecord
xmlns:load="http://IAS.bxLoad.schemas.bxCommonLoad"
xmlns:ns0="http://IAS.bxLoad.schemas.bxGenericLoadDoc">
<load:common entry_date="Jan 18 2005" entry_time="11:08"
load_type="DA"></load:common>
<bxRecord>
<bx:common record_id="34-784" business_date="Jan/15/2005"
abacus_unit_id="MMM"></bx:common>
<recordData>
<da:DARecord xmlns:da="http://D2M.schema.DARecord"
xmlns:ns0="http://D2M.schema.DAOriginal">
<id>34-784</id>
<code>000002</code>
</da:DARecord>
</recordData>
</bxRecord>
<bxRecord>
<bx:common record_id="34-785" business_date="Jan/15/2005"
abacus_unit_id="MMM"></bx:common>
<recordData>
<da:DARecord xmlns:da="http://D2M.schema.DARecord"
xmlns:ns0="http://D2M.schema.DAOriginal">
<id>34-785</id>
<code>000035</code>
</da:DARecord>
</recordData>
</bxRecord>
</ns0:Root>

I am trying to assign the "load:common" node to a separate message.
So far I've been trying lots of XPath-s, none attempt being
successful.

I thought the following piece of code will work:

xPathStatement = "/*[local-name='Root']/*[local-name()='common']";
bxCommonLoad = xpath(bxLoadDocMsg, xPathStatement);

But I get an XLang exception, "the part ‘part' of bxCommonLoad
contained a null value at the end of the construct block".

I've tried to debug the whole thing, with no real success either.

// debug info
str = xpath(bxLoadDocMsg, "string(/Root/common/@entry_date)");
//str = xpath(bxLoadDocMsg,
"string/*[local-name='Root']/*[local-name()='common']/@*[local-name()='entry_date'])");
System.Diagnostics.Debug.WriteLine("bxRecord entry data: " + str);

str = xpath(bxLoadDocMsg,
"string(/Root/bxRecord[1]/recordData/DARecord/id)");
System.Diagnostics.Debug.WriteLine("bxRecord id: " + str);

The debugger displays no str value…

Could anyone, please, help? And does anybody have a good XPath
reference?

TIA!
Alicia Marinache
almir2k@hotmail.com

2005-01-21, 5:50 pm

Well, never mind, it turns out it was a typo in the namespace
I managed to get the need info from my message...

Alicia

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com