I want to create a XML message dynamically in Orchestration, for that I have created a message of say msgXMLType of System.Xml.XmlDocument type and a varible varXMLDoc of System.Xml.XmlDocument type. Now, here are my queries
1) I need to create 2 nodes in msgXMLType with name <StoreUse> and <IDT>. How to do this? 2) after creating this message, I need to assign the values from xPath of a variable from RcvSchema. 3) I am looping through my detail records and need to assign the values of 2 elements of rcvSchema 'StoreUse' and 'IDT' from each detail while creating a new record each time in msgXML. 4) After assigning the values I need to loop through the msgXML to check if the value of next coming detail record exists in my msgXML. How can I loop thorugh the msgXML which I created dynamically?
Now 1st Loop will go through the detail record of rcvSchema values and the values will be inserted in msgXML with for loop counter increment. 2nd loop will exist on msgXML inside of 1st and I have to check the values of StoreUse and IDT which exist presently in first loop detail record. So 2nd loop will run through the msgXML checking for existing values as many as have been inserted matching the first loop counter.
I have a couple of thoughts about this: 1. To me this sounds much more like a job for a map. Any reason you are not using that? 2. If you really need to do all this dynamically without a map, I would write a .NET assembly that you can call from the orchestration that will return the XMLDocument. Whether you end up with an external assembly or doing it inside the orchestration, your question, I think, is more about programming with XML in .NET, which you might seek help for here: http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/threads. Baiscally, you will need an XmlWriter, that can be used roughly like this: