BizTalk Server Orchestration - Re: Problem using XPath selectSingleNode after receiving xml document

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > October 2004 > Re: Problem using XPath selectSingleNode after receiving xml document





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 Re: Problem using XPath selectSingleNode after receiving xml document
Matt Milner

2004-10-25, 5:48 pm

In this case, you need a namespace manager for your xmldocument since you
are not using the default namespace (i.e. you are using a named namespace).

i don't know if this is John's problem, but it is likely a namespace issue.
If you take a look at how the rules engine and other tools in BizTalk
reference nodes, they do so something like this (the exact syntax is
probably not right)

,"(//*[local-name()='NODE' AND namespace-uri()='http://myorders'])"

This allows you to specify the node name and namespace without needing to
use outside namespace managers. Try this type of xpath and see if that
works for you.

Matt


"Matt Meleski" <MattMeleski@discussions.microsoft.com> wrote in message
news:04D4A652-5CDC-4DFC-837A-FDA0BAB07333@microsoft.com...[vbcol=seagreen]
> John,
>
> I was having the exact same problem.
>
> The XML I was retrieving from my .Net class looked
> something like this :
>
>
> <Orders xmlns="http://myorders">
> <Order amount="100" />
> </Orders>
>
> When I generated a sample instance from BizTalk in VS2003 it looked like:
>
> <ns0:Orders xmlns:ns0="http://myorders">
> <Order amount="100" />
> </ns0:Orders>
>
> When I used xpath in an expression shape on the first sample of XML (from
> the .net class) it did not work.
>
> But : the xpath worked on the second sample of XML (generated in VS 2003).
>
> My solution was in my Orchestration :
> 1) Create two Orchestation Messages of my Order.xsd schema.
> 2) Have the first message constructed by the XML generated by the .net
> assembly
> 3) Have the second message generated by using a map, with the source being
> the First message. The map has the source and destination specifications
> as
> Order.xsd.
>
> When the second message is created it looks like below :
> <ns0:Orders xmlns:ns0="http://myorders">
> <Order amount="100" />
> </ns0:Orders>
> Therefore xpath on this xml worked.
>
> 4) Note : yes I am creating an exact duplicate of the first message , in
> the
> second message with the only difference being nso in the second message.
>
> Matt
>
>
>
>
>
> "John Smith" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com