Home Page › Forums › BizTalk 2004 – BizTalk 2010 › xPath looping problem
- This topic has 4 replies, 1 voice, and was last updated 9 years, 6 months ago by
community-content.
-
AuthorPosts
-
-
February 22, 2007 at 6:39 AM #17760
Hi everyone,
again i encountered a problem where I don't know how to go on.
I have a message body which looks like this
<ns0:Contract xmlns:ns0="http://ClaimSchemas.s_ExcelContract">
<OrgFileName>C:\Filedrop\test_8.xls</OrgFileName>
<Products>
<Product>
<ProdNr>0</ProdNr>
<StzThis>0.23</StzThis>
<StzLast>0.23</StzLast>
<NetPrice>0</NetPrice>
<GHRabatt>0.46</GHRabatt>
<Menge>0</Menge>
</Product>
</Products>
<LAUFZEIT_V>2006-10-01T00:00:00</LAUFZEIT_V>
<LAUFZEIT_B>2006-12-31T00:00:00</LAUFZEIT_B>
</ns0:Contract>Products can occur multiple times. I wanted to loop through the message with
ContractProduct = xpath(ExcelContract, "/*[local-name()='Contract' and namespace-uri()='http://ClaimSchemas.s_ExcelContract'%5D/*%5Blocal-name()='Products' and namespace-uri()=''/*[local-name()='Product' and namespace-uri()=''][" + strCount + "]");
but it tells me "invalid token" which seems to reference to the strCount number. I tried starting the strCount with 0 and 1 but neither worked… has anyone an idea what i might miss?
Regards,
Julian
-
February 22, 2007 at 8:20 AM #17764
I guess is that you forgot to close your bracket after 'Products' and namespace-uri=''
try this:
"/*[local-name()='Contract' and
namespace-uri()='http://ClaimSchemas.s_ExcelContract'%5D/*%5Blocal-name()='Products'
and namespace-uri()='']/*[local-name()='Product' and
namespace-uri()=''][" + strCount + "]");-weak architect
-
February 26, 2007 at 3:14 AM #17789
Yes this solved the problem.
But now i should be able to access the values inside the ContractProduct Message if I the fields are distinguished or do I miss something? Because I try to access them and send them to a .Net helper but all values are set to "Nothing". Now I thought the message assignment might not work but the output message which I store on disk contains all the values…
Any Ideas?
-
February 28, 2007 at 11:58 PM #17822
The problem still remains, I can't access the values of the constructed message though they will appear as expected if I write them to disk. I tried to assign the values to the Orchestration variables in the message assignment, in an expression shape right after the message construction, I tried to use the values directly when calling the helper method. I also tried to write them to the debug console and to the event viewer…
They are always "Nothing" but if i send them thorugh the pass through pipeline and write them to disk the values are in there … Did anyone encounter a similar problem?
-
March 1, 2007 at 4:51 AM #17828
Julian –
try to read about message and context properties. Maybe that's the problem.
http://blogs.msdn.com/dhtoran/archive/2005/07/07/436395.aspx
http://www.digitaldeposit.net/blog/2007/01/property-promotion-inside-orchestration.html
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.