Re: Problem using XPath selectSingleNode after receiving xml docum
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Re: Problem using XPath selectSingleNode after receiving xml docum




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Problem using XPath selectSingleNode after receiving xml docum  
Stephen W. Thomas


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-17-04 12:47 PM

Sorry, I should have explained that “XPath” is a reserved word in XLANG 
(i.e.
inside the Orchestration).   It is a short cut to get access to XML Document
s
and Messages inside the Orchestration.

So, the exact code that works outside the Orchestration should not look the
same inside the Orchestration.

You can find some more information on using XPath inside the Orchestration
by searching the help guide for: “Using XPaths in Message Assignment”.  
The
same code can be used to do XPath querries inside an Expression Shape as wel
l.

Let me know if you have additional questions.

Stephen W. Thomas
http://www.geekswithblogs.com/sthomas


"John Smith" wrote:

> Thanks for your reaction, but this was not really helpful, I'm sorry!
>
> In your example you create an empty xmldocument. After that, you introduce
> the variable xpath, of which I don't know the type. Is it a XPathNavigator
?
> Or a XPathNodeList?
>
> Shouldn't I first create a XPathDocument?
>
> Why does it work when I read the same file from the file system, and not i
f
> I get the document through an Orchestration Expression. I noticed that the
> document sent by biztalk has a lot of formatting with it, but that doesn't
> seem to be the problem. I saved the xml document produced by biztalk to th
e
> file system, and I had no problem processing the file.
>
> This is the complete function call:
>
> public void ProcesMsg(XLANGMessage msg)
>
> {
>
> XmlDocument aXmlDoc;
>
> XmlNodeList aSalesOrders;
>
> string aTo, aSubject, aBody, aAttachment;
>
>
> aXmlDoc = (XmlDocument) msg[0].RetrieveAs(typeof(XmlDocument));
>
>
> aSalesOrders = aXmlDoc.DocumentElement.ChildNodes;
>
> for (int i=0;i<aSalesOrders.Count;i++)
>
> {
>
> aTo = aSalesOrders[i].SelectSingleNode("ShipTo/Name").InnerText;
>
> if (aTo.Length >0)
>
> {
>
> aBody = TransformXML(aSalesOrders[i],"mappingBody.xsl");
>
> aSubject = "Uw Order";
>
> aAttachment = TransformXML(aSalesOrders[i],"mappingAttachment.xsl");
>
> System.Diagnostics.EventLog.WriteEntry("Confirmation Mail",aBody);
>
>  SendSMTPMail(aTo,aSubject,aBody,aAttachm
ent);
>
> }
>
> }
>
> }
>
>
> Best regards,
> Bas Dirkse (b_dirkse@hotmail.com)
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:13 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register