March 1, 2006 at 4:37 PM #13008
You can use the Xpath statement as an alternative to promoted fields.
myValue = Xpath(myMessage,\”string(\\Employees\\Employee\\Salary)\”);
You can dynamically build the xpath.
myVariableSubscript = myVariableSubscript + 1;
myXpath = \”string(\\Employees\\Employee[\” + System.Convert.ToString(myVariableSubscript) + \”]\\Salary)\”;
myValue = Xpath(myMessage,myXpath);
I have not dealt with numbers much, but I guess you could do this:
mySalary = String.Convert.ToDecimal(myValue);
You can get the full xpath by clicking on the element in the schema builder tool and going to the properties window. Due to namespaces, the xpath will be much longer, such as
[local-name()=\”Employees\” and namespace=\”http:/xxxxxxx\”]\\local-name()=\”Employee\” … and so on… See my blog nealwalters.blogspot.com for full details and dealing with this type of xpath.
March 1, 2006 at 8:05 PM #13009
Have you considered using the Cumulative Sum and Cumulative Average functoids
March 1, 2006 at 8:00 AM #13010
I have an xml schema which contains a record node. There will be multiple records in record node. I am using map to transform this to output schema. Some of the fields in output schema will be calculated from the multiple record elements.
There can be multiple choices of designing the system. I have decided to use loop functoid to calculate the sum and average of repeated values in Record element of input schema and map it to output schema.
Please suggest if instead of using loop functoid, I want to use the loop shape in orchestration, then how it will be possible as I am not able to promote any of attribute or element if it’s under record element.
Is there any alternative method to achieve the objective?
March 2, 2006 at 7:05 AM #13011
Thanks for the reply both the answer works fine.
But really I have not considerd using cumulative sum and average functoid. It is the simplest solution and works fine.
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.